{4:}{9:}{$C-,A+,D-}{[$C+,D+]}{:9}program MP;label{6:}1,9998,9999;
{:6}const{11:}memmax=30000;maxinternal=100;bufsize=500;errorline=72;
halferrorline=42;maxprintline=79;emergencylinelength=255;stacksize=30;
maxreadfiles=4;maxstrings=2500;stringvacancies=9000;stringsvacant=1000;
poolsize=32000;fontmax=50;fontmemsize=10000;filenamesize=40;
poolname='MPlib:MP.POOL                         ';
pstabname='MPlib:PSFONTS.MAP                     ';pathsize=300;
bistacksize=785;headersize=100;ligtablesize=5000;maxkerns=500;
maxfontdimen=50;{:11}type{18:}ASCIIcode=0..255;
{:18}{24:}eightbits=0..255;alphafile=packed file of char;
bytefile=packed file of eightbits;{:24}{37:}poolpointer=0..poolsize;
strnumber=0..maxstrings;poolASCIIcode=0..255;{:37}{115:}scaled=integer;
smallnumber=0..63;{:115}{119:}fraction=integer;
{:119}{120:}angle=integer;{:120}{170:}quarterword=0..255;
halfword=0..65535;twochoices=1..2;threechoices=1..3;
twohalves=packed record rh:halfword;case twochoices of 1:(lh:halfword);
2:(b0:quarterword;b1:quarterword);end;
fourquarters=packed record b0:quarterword;b1:quarterword;b2:quarterword;
b3:quarterword;end;
memoryword=record case threechoices of 1:(int:integer);2:(hh:twohalves);
3:(qqqq:fourquarters);end;wordfile=file of memoryword;
{:170}{203:}commandcode=1..84;
{:203}{582:}instaterecord=record indexfield:quarterword;
startfield,locfield,limitfield,namefield:halfword;end;
{:582}{780:}readfindex=0..maxreadfiles;writeindex=0..4;
{:780}{1188:}fontnumber=0..fontmax;{:1188}{1213:}fmentryptr=^integer;
nonnegativeinteger=0..2147483647;{:1213}var{13:}bad:integer;
{:13}{20:}xord:array[char]of ASCIIcode;xchr:array[ASCIIcode]of char;
{:20}{25:}nameoffile:packed array[1..filenamesize]of char;
namelength:0..filenamesize;
{:25}{29:}buffer:array[0..bufsize]of ASCIIcode;first:0..bufsize;
last:0..bufsize;maxbufstack:0..bufsize;{:29}{31:}termin:alphafile;
termout:alphafile;
{:31}{38:}strpool:packed array[poolpointer]of poolASCIIcode;
strstart:array[strnumber]of poolpointer;
nextstr:array[strnumber]of strnumber;poolptr:poolpointer;
strptr:strnumber;initpoolptr:poolpointer;initstruse:strnumber;
maxpoolptr:poolpointer;maxstrptr:strnumber;{:38}{39:}strsusedup:integer;
poolinuse:integer;strsinuse:integer;maxplused:integer;
maxstrsused:integer;{:39}{44:}strref:array[strnumber]of 0..127;
{:44}{48:}lastfixedstr:strnumber;fixedstruse:strnumber;
{:48}{56:}stroverflowed:boolean;{:56}{58:}pactcount:integer;
pactchars:integer;pactstrs:integer;{:58}{65:}poolfile:alphafile;
{:65}{68:}logfile:alphafile;psfile:alphafile;selector:0..10;
dig:array[0..22]of 0..15;tally:integer;termoffset:0..maxprintline;
fileoffset:0..maxprintline;psoffset:integer;
trickbuf:array[0..errorline]of ASCIIcode;trickcount:integer;
firstcount:integer;{:68}{82:}interaction:0..3;
{:82}{85:}deletionsallowed:boolean;history:0..3;errorcount:-1..100;
{:85}{88:}helpline:array[0..5]of strnumber;helpptr:0..6;
useerrhelp:boolean;errhelp:strnumber;filenametemplate:strnumber;
{:88}{105:}interrupt:integer;OKtointerrupt:boolean;
{:105}{111:}aritherror:boolean;
{:111}{143:}twotothe:array[0..30]of integer;
speclog:array[1..28]of integer;
{:143}{151:}specatan:array[1..26]of angle;
{:151}{158:}nsin,ncos:fraction;
{:158}{162:}randoms:array[0..54]of fraction;jrandom:0..54;
sysrandomseed:scaled;{:162}{173:}mem:array[0..memmax]of memoryword;
lomemmax:halfword;himemmin:halfword;{:173}{174:}varused,dynused:integer;
{:174}{175:}avail:halfword;memend:halfword;{:175}{180:}rover:halfword;
{:180}{192:}{free:packed array[0..memmax]of boolean;
wasfree:packed array[0..memmax]of boolean;
wasmemend,waslomax,washimin:halfword;panicking:boolean;}
{:192}{207:}internal:array[1..maxinternal]of scaled;
intname:array[1..maxinternal]of strnumber;intptr:37..maxinternal;
{:207}{214:}oldsetting,nonpssetting:0..10;
{:214}{216:}charclass:array[ASCIIcode]of 0..20;
{:216}{218:}hashused:halfword;stcount:integer;
{:218}{219:}hash:array[1..2371]of twohalves;
eqtb:array[1..2371]of twohalves;{:219}{244:}gpointer:halfword;
{:244}{249:}bignodesize:array[12..15]of smallnumber;
sector0:array[12..15]of smallnumber;
sectoroffset:array[5..17]of smallnumber;{:249}{269:}saveptr:halfword;
{:269}{288:}pathtail:halfword;
{:288}{301:}deltax,deltay,delta:array[0..pathsize]of scaled;
psi:array[1..pathsize]of angle;
{:301}{305:}theta:array[0..pathsize]of angle;
uu:array[0..pathsize]of fraction;vv:array[0..pathsize]of angle;
ww:array[0..pathsize]of fraction;{:305}{320:}st,ct,sf,cf:fraction;
{:320}{330:}bbmin,bbmax:array[0..1]of scaled;
{:330}{374:}halfcos:array[0..7]of fraction;dcos:array[0..7]of fraction;
{:374}{388:}curx,cury:scaled;
{:388}{402:}grobjectsize:array[1..7]of smallnumber;
{:402}{463:}specoffset:integer;{:463}{465:}specp1,specp2:halfword;
{:465}{527:}tolstep:0..6;
{:527}{528:}bisectstack:array[0..bistacksize]of integer;
bisectptr:0..bistacksize;{:528}{531:}curt,curtt:integer;
timetogo:integer;maxt:integer;{:531}{533:}delx,dely:integer;tol:integer;
uv,xy:0..bistacksize;threel:integer;apprt,apprtt:integer;
{:533}{540:}serialno:integer;{:540}{547:}fixneeded:boolean;
watchcoefs:boolean;depfinal:halfword;{:547}{579:}curcmd:eightbits;
curmod:integer;cursym:halfword;
{:579}{583:}inputstack:array[0..stacksize]of instaterecord;
inputptr:0..stacksize;maxinstack:0..stacksize;curinput:instaterecord;
{:583}{586:}inopen:0..6;openparens:0..6;
inputfile:array[1..6]of alphafile;linestack:array[0..6]of integer;
inamestack:array[0..6]of strnumber;iareastack:array[0..6]of strnumber;
mpxname:array[0..6]of halfword;
{:586}{588:}paramstack:array[0..150]of halfword;paramptr:0..150;
maxparamstack:integer;{:588}{590:}fileptr:0..stacksize;
{:590}{619:}scannerstatus:0..7;warninginfo:integer;
{:619}{642:}forceeof:boolean;{:642}{672:}bgloc,egloc:1..2371;
{:672}{711:}condptr:halfword;iflimit:0..4;curif:smallnumber;
ifline:integer;{:711}{725:}loopptr:halfword;
{:725}{744:}curname:strnumber;curarea:strnumber;curext:strnumber;
{:744}{746:}areadelimiter:integer;extdelimiter:integer;
{:746}{753:}MPmemdefault:packed array[1..15]of char;
{:753}{761:}jobname:strnumber;logopened:boolean;logname:strnumber;
{:761}{776:}oldfilename:packed array[1..filenamesize]of char;
oldnamelength:0..filenamesize;
{:776}{781:}rdfile:array[readfindex]of alphafile;
rdfname:array[readfindex]of strnumber;readfiles:readfindex;
wrfile:array[writeindex]of alphafile;
wrfname:array[writeindex]of strnumber;writefiles:writeindex;
{:781}{785:}curtype:smallnumber;curexp:integer;
{:785}{802:}maxc:array[18..19]of integer;
maxptr:array[18..19]of halfword;maxlink:array[18..19]of halfword;
{:802}{810:}varflag:0..84;{:810}{905:}sepic:halfword;sesf:scaled;
{:905}{932:}eofline:strnumber;{:932}{966:}txx,txy,tyx,tyy,tx,ty:scaled;
{:966}{1099:}lastaddtype:quarterword;{:1099}{1115:}startsym:halfword;
{:1115}{1123:}longhelpseen:boolean;{:1123}{1132:}tfmfile:bytefile;
metricfilename:strnumber;{:1132}{1141:}bc,ec:eightbits;
tfmwidth:array[eightbits]of scaled;tfmheight:array[eightbits]of scaled;
tfmdepth:array[eightbits]of scaled;
tfmitalcorr:array[eightbits]of scaled;
charexists:array[eightbits]of boolean;chartag:array[eightbits]of 0..3;
charremainder:array[eightbits]of 0..ligtablesize;
headerbyte:array[1..headersize]of-1..255;
ligkern:array[0..ligtablesize]of fourquarters;nl:0..32511;
kern:array[0..maxkerns]of scaled;nk:0..maxkerns;
exten:array[eightbits]of fourquarters;ne:0..256;
param:array[1..maxfontdimen]of scaled;np:0..maxfontdimen;
nw,nh,nd,ni:0..256;skiptable:array[eightbits]of 0..ligtablesize;
lkstarted:boolean;bchar:integer;bchlabel:0..ligtablesize;
ll,lll:0..ligtablesize;labelloc:array[0..256]of-1..ligtablesize;
labelchar:array[1..256]of eightbits;labelptr:0..256;
{:1141}{1164:}perturbation:scaled;excess:integer;
{:1164}{1170:}dimenhead:array[1..4]of halfword;
{:1170}{1175:}maxtfmdimen:scaled;tfmchanged:integer;
{:1175}{1187:}tfminfile:bytefile;
{:1187}{1189:}fontinfo:array[0..fontmemsize]of memoryword;
fontencname:array[fontnumber]of strnumber;
fontpsnamefixed:array[fontnumber]of boolean;mpfontmap:^fmentryptr;
nextfmem:0..fontmemsize;lastfnum:fontnumber;
fontdsize:array[fontnumber]of scaled;
fontname:array[fontnumber]of strnumber;
fontpsname:array[fontnumber]of strnumber;lastpsfnum:fontnumber;
fontbc,fontec:array[fontnumber]of eightbits;
{:1189}{1190:}charbase:array[fontnumber]of 0..fontmemsize;
widthbase:array[fontnumber]of 0..fontmemsize;
heightbase:array[fontnumber]of 0..fontmemsize;
depthbase:array[fontnumber]of 0..fontmemsize;{:1190}{1214:}onebp:scaled;
onehundredbp:scaled;onehundredinch:scaled;tenpow:array[0..9]of integer;
scaledout:integer;{:1214}{1218:}pstabfile:alphafile;
{:1218}{1226:}firstfilename,lastfilename:strnumber;
firstoutputcode,lastoutputcode:integer;totalshipped:integer;
{:1226}{1234:}neednewpath:boolean;{:1234}{1237:}gsstate:halfword;
{:1237}{1273:}fontsizes:array[fontnumber]of halfword;
{:1273}{1277:}lastpending:halfword;{:1277}{1312:}memident:strnumber;
{:1312}{1317:}memfile:wordfile;{:1317}{1332:}readyalready:integer;
{:1332}procedure initialize;var{19:}i:integer;{:19}{144:}k:integer;
{:144}begin{21:}xchr[32]:=' ';xchr[33]:='!';xchr[34]:='"';xchr[35]:='#';
xchr[36]:='$';xchr[37]:='%';xchr[38]:='&';xchr[39]:='''';xchr[40]:='(';
xchr[41]:=')';xchr[42]:='*';xchr[43]:='+';xchr[44]:=',';xchr[45]:='-';
xchr[46]:='.';xchr[47]:='/';xchr[48]:='0';xchr[49]:='1';xchr[50]:='2';
xchr[51]:='3';xchr[52]:='4';xchr[53]:='5';xchr[54]:='6';xchr[55]:='7';
xchr[56]:='8';xchr[57]:='9';xchr[58]:=':';xchr[59]:=';';xchr[60]:='<';
xchr[61]:='=';xchr[62]:='>';xchr[63]:='?';xchr[64]:='@';xchr[65]:='A';
xchr[66]:='B';xchr[67]:='C';xchr[68]:='D';xchr[69]:='E';xchr[70]:='F';
xchr[71]:='G';xchr[72]:='H';xchr[73]:='I';xchr[74]:='J';xchr[75]:='K';
xchr[76]:='L';xchr[77]:='M';xchr[78]:='N';xchr[79]:='O';xchr[80]:='P';
xchr[81]:='Q';xchr[82]:='R';xchr[83]:='S';xchr[84]:='T';xchr[85]:='U';
xchr[86]:='V';xchr[87]:='W';xchr[88]:='X';xchr[89]:='Y';xchr[90]:='Z';
xchr[91]:='[';xchr[92]:='\';xchr[93]:=']';xchr[94]:='^';xchr[95]:='_';
xchr[96]:='`';xchr[97]:='a';xchr[98]:='b';xchr[99]:='c';xchr[100]:='d';
xchr[101]:='e';xchr[102]:='f';xchr[103]:='g';xchr[104]:='h';
xchr[105]:='i';xchr[106]:='j';xchr[107]:='k';xchr[108]:='l';
xchr[109]:='m';xchr[110]:='n';xchr[111]:='o';xchr[112]:='p';
xchr[113]:='q';xchr[114]:='r';xchr[115]:='s';xchr[116]:='t';
xchr[117]:='u';xchr[118]:='v';xchr[119]:='w';xchr[120]:='x';
xchr[121]:='y';xchr[122]:='z';xchr[123]:='{';xchr[124]:='|';
xchr[125]:='}';xchr[126]:='~';{:21}{22:}for i:=0 to 31 do xchr[i]:=' ';
for i:=127 to 255 do xchr[i]:=' ';
{:22}{23:}for i:=0 to 255 do xord[chr(i)]:=127;
for i:=128 to 255 do xord[xchr[i]]:=i;
for i:=0 to 126 do xord[xchr[i]]:=i;{:23}{83:}interaction:=3;
{:83}{86:}deletionsallowed:=true;errorcount:=0;{:86}{89:}helpptr:=0;
useerrhelp:=false;errhelp:=0;filenametemplate:=0;
{:89}{106:}interrupt:=0;OKtointerrupt:=true;
{:106}{112:}aritherror:=false;{:112}{145:}twotothe[0]:=1;
for k:=1 to 30 do twotothe[k]:=2*twotothe[k-1];speclog[1]:=93032640;
speclog[2]:=38612034;speclog[3]:=17922280;speclog[4]:=8662214;
speclog[5]:=4261238;speclog[6]:=2113709;speclog[7]:=1052693;
speclog[8]:=525315;speclog[9]:=262400;speclog[10]:=131136;
speclog[11]:=65552;speclog[12]:=32772;speclog[13]:=16385;
for k:=14 to 27 do speclog[k]:=twotothe[27-k];speclog[28]:=1;
{:145}{152:}specatan[1]:=27855475;specatan[2]:=14718068;
specatan[3]:=7471121;specatan[4]:=3750058;specatan[5]:=1876857;
specatan[6]:=938658;specatan[7]:=469357;specatan[8]:=234682;
specatan[9]:=117342;specatan[10]:=58671;specatan[11]:=29335;
specatan[12]:=14668;specatan[13]:=7334;specatan[14]:=3667;
specatan[15]:=1833;specatan[16]:=917;specatan[17]:=458;
specatan[18]:=229;specatan[19]:=115;specatan[20]:=57;specatan[21]:=29;
specatan[22]:=14;specatan[23]:=7;specatan[24]:=4;specatan[25]:=2;
specatan[26]:=1;{:152}{193:}{wasmemend:=0;waslomax:=0;washimin:=memmax;
panicking:=false;}{:193}{208:}for k:=1 to 37 do internal[k]:=0;
intptr:=37;{:208}{217:}for k:=48 to 57 do charclass[k]:=0;
charclass[46]:=1;charclass[32]:=2;charclass[37]:=3;charclass[34]:=4;
charclass[44]:=5;charclass[59]:=6;charclass[40]:=7;charclass[41]:=8;
for k:=65 to 90 do charclass[k]:=9;for k:=97 to 122 do charclass[k]:=9;
charclass[95]:=9;charclass[60]:=10;charclass[61]:=10;charclass[62]:=10;
charclass[58]:=10;charclass[124]:=10;charclass[96]:=11;
charclass[39]:=11;charclass[43]:=12;charclass[45]:=12;charclass[47]:=13;
charclass[42]:=13;charclass[92]:=13;charclass[33]:=14;charclass[63]:=14;
charclass[35]:=15;charclass[38]:=15;charclass[64]:=15;charclass[36]:=15;
charclass[94]:=16;charclass[126]:=16;charclass[91]:=17;
charclass[93]:=18;charclass[123]:=19;charclass[125]:=19;
for k:=0 to 31 do charclass[k]:=20;
for k:=127 to 255 do charclass[k]:=20;{:217}{220:}hash[1].lh:=0;
hash[1].rh:=0;eqtb[1].lh:=43;eqtb[1].rh:=0;
for k:=2 to 2371 do begin hash[k]:=hash[1];eqtb[k]:=eqtb[1];end;
{:220}{250:}bignodesize[12]:=12;bignodesize[15]:=4;bignodesize[13]:=6;
bignodesize[14]:=8;sector0[12]:=5;sector0[15]:=5;sector0[13]:=11;
sector0[14]:=14;for k:=5 to 10 do sectoroffset[k]:=2*(k-5);
for k:=11 to 13 do sectoroffset[k]:=2*(k-11);
for k:=14 to 17 do sectoroffset[k]:=2*(k-14);{:250}{270:}saveptr:=0;
{:270}{375:}halfcos[0]:=134217728;halfcos[1]:=94906266;halfcos[2]:=0;
dcos[0]:=35596755;dcos[1]:=25170707;dcos[2]:=0;
for k:=3 to 4 do begin halfcos[k]:=-halfcos[4-k];dcos[k]:=-dcos[4-k];
end;for k:=5 to 7 do begin halfcos[k]:=halfcos[8-k];dcos[k]:=dcos[8-k];
end;{:375}{403:}grobjectsize[1]:=9;grobjectsize[2]:=11;
grobjectsize[3]:=17;grobjectsize[4]:=2;grobjectsize[6]:=2;
grobjectsize[5]:=2;grobjectsize[7]:=2;{:403}{466:}specp1:=0;specp2:=0;
{:466}{548:}fixneeded:=false;watchcoefs:=true;{:548}{712:}condptr:=0;
iflimit:=0;curif:=0;ifline:=0;{:712}{726:}loopptr:=0;
{:726}{745:}curname:=287;curarea:=287;curext:=287;
{:745}{754:}MPmemdefault:='MPlib:plain.mem';{:754}{782:}readfiles:=0;
writefiles:=0;{:782}{786:}curexp:=0;{:786}{811:}varflag:=0;
{:811}{933:}eofline:=0;{:933}{1116:}startsym:=0;
{:1116}{1124:}longhelpseen:=false;
{:1124}{1142:}for k:=0 to 255 do begin tfmwidth[k]:=0;tfmheight[k]:=0;
tfmdepth[k]:=0;tfmitalcorr[k]:=0;charexists[k]:=false;chartag[k]:=0;
charremainder[k]:=0;skiptable[k]:=ligtablesize;end;
for k:=1 to headersize do headerbyte[k]:=-1;bc:=255;ec:=0;nl:=0;nk:=0;
ne:=0;np:=0;internal[31]:=-65536;bchlabel:=ligtablesize;labelloc[0]:=-1;
labelptr:=0;{:1142}{1215:}onebp:=65782;onehundredbp:=6578176;
onehundredinch:=473628672;tenpow[0]:=1;
for i:=1 to 9 do tenpow[i]:=10*tenpow[i-1];
mpfontmap:=xmallocarray(fmentryptr,fontmax);
for i:=0 to fontmax do begin fontencname[i]:=0;
fontpsnamefixed[i]:=false;mpfontmap[i]:=0;end;
{:1215}{1227:}firstfilename:=287;lastfilename:=287;
firstoutputcode:=32768;lastoutputcode:=-32768;totalshipped:=0;
{:1227}{1238:}gsstate:=0;{:1238}{1278:}lastpending:=29997;
{:1278}{1313:}memident:=0;{:1313}end;{71:}procedure println;
begin case selector of 10:begin writeln(termout);writeln(logfile);
termoffset:=0;fileoffset:=0;end;9:begin writeln(logfile);fileoffset:=0;
end;8:begin writeln(termout);termoffset:=0;end;5:begin writeln(psfile);
psoffset:=0;end;7,6,4:;others:writeln(wrfile[selector])end;end;
{:71}{72:}procedure unitstrroom;forward;
procedure printvisiblechar(s:ASCIIcode);label 30;
begin case selector of 10:begin write(termout,xchr[s]);
write(logfile,xchr[s]);termoffset:=termoffset+1;
fileoffset:=fileoffset+1;
if termoffset=maxprintline then begin writeln(termout);termoffset:=0;
end;if fileoffset=maxprintline then begin writeln(logfile);
fileoffset:=0;end;end;9:begin write(logfile,xchr[s]);
fileoffset:=fileoffset+1;if fileoffset=maxprintline then println;end;
8:begin write(termout,xchr[s]);termoffset:=termoffset+1;
if termoffset=maxprintline then println;end;
5:if s=13 then begin writeln(psfile);psoffset:=0;
end else begin write(psfile,xchr[s]);psoffset:=psoffset+1;end;7:;
6:if tally<trickcount then trickbuf[tally mod errorline]:=s;
4:begin if poolptr>=maxpoolptr then begin unitstrroom;
if poolptr>=poolsize then goto 30;end;begin strpool[poolptr]:=s;
poolptr:=poolptr+1;end;end;others:write(wrfile[selector],xchr[s])end;
30:tally:=tally+1;end;{:72}{73:}procedure printchar(k:ASCIIcode);
var l:0..255;
begin if selector<6 then printvisiblechar(k)else if{64:}(k<32)or(k>126)
{:64}then begin printvisiblechar(94);printvisiblechar(94);
if k<64 then printvisiblechar(k+64)else if k<128 then printvisiblechar(k
-64)else begin l:=k div 16;
if l<10 then printvisiblechar(l+48)else printvisiblechar(l+87);
l:=k mod 16;
if l<10 then printvisiblechar(l+48)else printvisiblechar(l+87);end;
end else printvisiblechar(k);end;{:73}{74:}procedure print(s:integer);
var j:poolpointer;begin if(s<0)or(s>maxstrptr)then s:=261;
j:=strstart[s];
while j<strstart[nextstr[s]]do begin printchar(strpool[j]);j:=j+1;end;
end;{:74}{76:}procedure printnl(s:strnumber);
begin case selector of 10:if(termoffset>0)or(fileoffset>0)then println;
9:if fileoffset>0 then println;8:if termoffset>0 then println;
5:if psoffset>0 then println;7,6,4:;end;print(s);end;
{:76}{77:}procedure printthedigs(k:eightbits);
begin while k>0 do begin k:=k-1;printchar(48+dig[k]);end;end;
{:77}{78:}procedure printint(n:integer);var k:0..23;m:integer;
begin k:=0;if n<0 then begin printchar(45);
if n>-100000000 then n:=-n else begin m:=-1-n;n:=m div 10;
m:=(m mod 10)+1;k:=1;if m<10 then dig[0]:=m else begin dig[0]:=0;n:=n+1;
end;end;end;repeat dig[k]:=n mod 10;n:=n div 10;k:=k+1;until n=0;
printthedigs(k);end;{:78}{117:}procedure printscaled(s:scaled);
var delta:scaled;begin if s<0 then begin printchar(45);s:=-s;end;
printint(s div 65536);s:=10*(s mod 65536)+5;
if s<>5 then begin delta:=10;printchar(46);
repeat if delta>65536 then s:=s+32768-(delta div 2);
printchar(48+(s div 65536));s:=10*(s mod 65536);delta:=delta*10;
until s<=delta;end;end;{:117}{118:}procedure printtwo(x,y:scaled);
begin printchar(40);printscaled(x);printchar(44);printscaled(y);
printchar(41);end;{:118}{204:}procedure printtype(t:smallnumber);
begin case t of 1:print(327);2:print(328);3:print(329);4:print(260);
5:print(330);6:print(331);7:print(332);8:print(333);9:print(334);
10:print(335);11:print(336);12:print(337);13:print(338);14:print(339);
15:print(340);17:print(341);18:print(342);19:print(343);16:print(344);
20:print(345);21:print(346);22:print(347);23:print(348);24:print(349);
others:print(350)end;end;{:204}{213:}{589:}function trueline:integer;
var k:0..stacksize;
begin if(curinput.indexfield<=6)and(curinput.namefield>2)then trueline:=
linestack[curinput.indexfield]else begin k:=inputptr;
while(k>0)and(inputstack[k].indexfield>6)or(inputstack[k].namefield<=2)
do k:=k-1;trueline:=linestack[k];end;end;
{:589}procedure begindiagnostic;begin oldsetting:=selector;
if selector=5 then selector:=nonpssetting;
if(internal[12]<=0)and(selector=10)then begin selector:=selector-1;
if history=0 then history:=1;end;end;
procedure enddiagnostic(blankline:boolean);begin printnl(287);
if blankline then println;selector:=oldsetting;end;
{:213}{215:}procedure printdiagnostic(s,t:strnumber;nuline:boolean);
begin begindiagnostic;if nuline then printnl(s)else print(s);print(267);
printint(trueline);print(t);printchar(58);end;
{:215}{751:}procedure printfilename(n,a,e:integer);begin print(a);
print(n);print(e);end;{:751}{87:}procedure normalizeselector;forward;
procedure getnext;forward;procedure terminput;forward;
procedure showcontext;forward;procedure beginfilereading;forward;
procedure openlogfile;forward;procedure closefilesandterminate;forward;
procedure clearforerrorprompt;forward;{procedure debughelp;forward;}
{45:}procedure flushstring(s:strnumber);
begin{poolinuse:=poolinuse-(strstart[nextstr[s]]-strstart[s]);
strsinuse:=strsinuse-1;}
if nextstr[s]<>strptr then strref[s]:=0 else begin strptr:=s;
strsusedup:=strsusedup-1;end;poolptr:=strstart[strptr];end;
{:45}{:87}{90:}procedure jumpout;begin goto 9998;end;
{:90}{91:}procedure error;label 22,10;var c:ASCIIcode;s1,s2,s3:integer;
j:poolpointer;begin if history<2 then history:=2;printchar(46);
showcontext;
if interaction=3 then{92:}while true do begin 22:clearforerrorprompt;
begin;print(265);terminput;end;if last=first then goto 10;
c:=buffer[first];if c>=97 then c:=c-32;
{93:}case c of 48,49,50,51,52,53,54,55,56,57:if deletionsallowed then
{97:}begin s1:=curcmd;s2:=curmod;s3:=cursym;OKtointerrupt:=false;
if(last>first+1)and(buffer[first+1]>=48)and(buffer[first+1]<=57)then c:=
c*10+buffer[first+1]-48*11 else c:=c-48;while c>0 do begin getnext;
{716:}if curcmd=41 then begin if strref[curmod]<127 then if strref[
curmod]>1 then strref[curmod]:=strref[curmod]-1 else flushstring(curmod)
;end{:716};c:=c-1;end;curcmd:=s1;curmod:=s2;cursym:=s3;
OKtointerrupt:=true;begin helpptr:=2;helpline[1]:=280;helpline[0]:=281;
end;showcontext;goto 22;end{:97};{68:begin debughelp;goto 22;end;}
69:if fileptr>0 then begin printnl(266);
print(inputstack[fileptr].namefield);print(267);printint(trueline);
interaction:=2;jumpout;end;
72:{98:}begin if useerrhelp then begin{99:}j:=strstart[errhelp];
while j<strstart[nextstr[errhelp]]do begin if strpool[j]<>37 then print(
strpool[j])else if j+1=strstart[nextstr[errhelp]]then println else if
strpool[j+1]<>37 then println else begin j:=j+1;printchar(37);end;
j:=j+1;end{:99};useerrhelp:=false;
end else begin if helpptr=0 then begin helpptr:=2;helpline[1]:=282;
helpline[0]:=283;end;repeat helpptr:=helpptr-1;print(helpline[helpptr]);
println;until helpptr=0;end;begin helpptr:=4;helpline[3]:=284;
helpline[2]:=283;helpline[1]:=285;helpline[0]:=286;end;goto 22;end{:98};
73:{96:}begin beginfilereading;
if last>first+1 then begin curinput.locfield:=first+1;buffer[first]:=32;
end else begin begin;print(279);terminput;end;curinput.locfield:=first;
end;first:=last+1;curinput.limitfield:=last;goto 10;end{:96};
81,82,83:{95:}begin errorcount:=0;interaction:=0+c-81;print(274);
case c of 81:begin print(275);selector:=selector-1;end;82:print(276);
83:print(277);end;print(278);println;break(termout);goto 10;end{:95};
88:begin interaction:=2;jumpout;end;others:end;{94:}begin print(268);
printnl(269);printnl(270);if fileptr>0 then print(271);
if deletionsallowed then printnl(272);printnl(273);end{:94}{:93};
end{:92};errorcount:=errorcount+1;
if errorcount=100 then begin printnl(264);history:=3;jumpout;end;
{100:}if interaction>0 then selector:=selector-1;
if useerrhelp then begin printnl(287);{99:}j:=strstart[errhelp];
while j<strstart[nextstr[errhelp]]do begin if strpool[j]<>37 then print(
strpool[j])else if j+1=strstart[nextstr[errhelp]]then println else if
strpool[j+1]<>37 then println else begin j:=j+1;printchar(37);end;
j:=j+1;end{:99};end else while helpptr>0 do begin helpptr:=helpptr-1;
printnl(helpline[helpptr]);end;println;
if interaction>0 then selector:=selector+1;println{:100};10:end;
{:91}{102:}procedure fatalerror(s:strnumber);begin normalizeselector;
begin if interaction=3 then;printnl(263);print(288);end;
begin helpptr:=1;helpline[0]:=s;end;
begin if interaction=3 then interaction:=2;if logopened then error;
{if interaction>0 then debughelp;}history:=3;jumpout;end;end;
{:102}{103:}procedure overflow(s:strnumber;n:integer);
begin normalizeselector;begin if interaction=3 then;printnl(263);
print(289);end;print(s);printchar(61);printint(n);printchar(93);
begin helpptr:=2;helpline[1]:=290;helpline[0]:=291;end;
begin if interaction=3 then interaction:=2;if logopened then error;
{if interaction>0 then debughelp;}history:=3;jumpout;end;end;
{:103}{104:}procedure confusion(s:strnumber);begin normalizeselector;
if history<2 then begin begin if interaction=3 then;printnl(263);
print(292);end;print(s);printchar(41);begin helpptr:=1;helpline[0]:=293;
end;end else begin begin if interaction=3 then;printnl(263);print(294);
end;begin helpptr:=2;helpline[1]:=295;helpline[0]:=296;end;end;
begin if interaction=3 then interaction:=2;if logopened then error;
{if interaction>0 then debughelp;}history:=3;jumpout;end;end;
{:104}{:4}{26:}function aopenin(var f:alphafile):boolean;
begin reset(f,nameoffile,'/O');aopenin:=erstat(f)=0;end;
function aopenout(var f:alphafile):boolean;
begin rewrite(f,nameoffile,'/O');aopenout:=erstat(f)=0;end;
function bopenin(var f:bytefile):boolean;begin reset(f,nameoffile,'/O');
bopenin:=erstat(f)=0;end;function bopenout(var f:bytefile):boolean;
begin rewrite(f,nameoffile,'/O');bopenout:=erstat(f)=0;end;
function wopenin(var f:wordfile):boolean;begin reset(f,nameoffile,'/O');
wopenin:=erstat(f)=0;end;function wopenout(var f:wordfile):boolean;
begin rewrite(f,nameoffile,'/O');wopenout:=erstat(f)=0;end;
{:26}{27:}procedure aclose(var f:alphafile);begin close(f);end;
procedure bclose(var f:bytefile);begin close(f);end;
procedure wclose(var f:wordfile);begin close(f);end;
{:27}{30:}function inputln(var f:alphafile;bypasseoln:boolean):boolean;
var lastnonblank:0..bufsize;
begin if bypasseoln then if not eof(f)then get(f);last:=first;
if eof(f)then inputln:=false else begin lastnonblank:=first;
while not eoln(f)do begin if last>=maxbufstack then begin maxbufstack:=
last+1;
if maxbufstack=bufsize then{34:}if memident=0 then begin writeln(termout
,'Buffer size exceeded!');goto 9999;
end else begin curinput.locfield:=first;curinput.limitfield:=last-1;
overflow(257,bufsize);end{:34};end;buffer[last]:=xord[f^];get(f);
last:=last+1;if buffer[last-1]<>32 then lastnonblank:=last;end;
last:=lastnonblank;inputln:=true;end;end;
{:30}{36:}function initterminal:boolean;label 10;
begin reset(termin,'TTY:','/O/I');while true do begin;
write(termout,'**');break(termout);
if not inputln(termin,true)then begin writeln(termout);
write(termout,'! End of file on the terminal... why?');
initterminal:=false;goto 10;end;curinput.locfield:=first;
while(curinput.locfield<last)and(buffer[curinput.locfield]=32)do
curinput.locfield:=curinput.locfield+1;
if curinput.locfield<last then begin initterminal:=true;goto 10;end;
writeln(termout,'Please type the name of your input file.');end;10:end;
{:36}{46:}{49:}procedure docompaction(needed:poolpointer);label 30;
var struse:strnumber;r,s,t:strnumber;p,q:poolpointer;
begin{50:}t:=nextstr[lastfixedstr];
while(strref[t]=127)and(t<>strptr)do begin fixedstruse:=fixedstruse+1;
lastfixedstr:=t;t:=nextstr[t];end;struse:=fixedstruse{:50};
r:=lastfixedstr;s:=nextstr[r];p:=strstart[s];
while s<>strptr do begin while strref[s]=0 do{51:}begin t:=s;
s:=nextstr[s];nextstr[r]:=s;nextstr[t]:=nextstr[strptr];
nextstr[strptr]:=t;if s=strptr then goto 30;end{:51};r:=s;s:=nextstr[s];
struse:=struse+1;{52:}q:=strstart[r];strstart[r]:=p;
while q<strstart[s]do begin strpool[p]:=strpool[q];p:=p+1;q:=q+1;
end{:52};end;30:{54:}q:=strstart[strptr];strstart[strptr]:=p;
while q<poolptr do begin strpool[p]:=strpool[q];p:=p+1;q:=q+1;end;
poolptr:=p{:54};
if needed<poolsize then{55:}begin if struse>=maxstrings-1 then begin
stroverflowed:=true;overflow(258,maxstrings-1-initstruse);end;
if poolptr+needed>maxpoolptr then if poolptr+needed>poolsize then begin
stroverflowed:=true;overflow(259,poolsize-initpoolptr);
end else maxpoolptr:=poolptr+needed;end{:55};
{[57:]if(strstart[strptr]<>poolinuse)or(struse<>strsinuse)then confusion
(260);pactcount:=pactcount+1;
pactchars:=pactchars+poolptr-strstart[nextstr[lastfixedstr]];
pactstrs:=pactstrs+struse-fixedstruse;[s:=strptr;t:=struse;
while s<=maxstrptr do begin if t>maxstrptr then confusion(34);t:=t+1;
s:=nextstr[s];end;if t<=maxstrptr then confusion(34);][:57];}
strsusedup:=struse;end;{:49}{43:}procedure unitstrroom;
begin if poolptr>=poolsize then docompaction(poolsize);
if poolptr>=maxpoolptr then maxpoolptr:=poolptr+1;end;
{:43}function makestring:strnumber;label 20;var s:strnumber;
begin 20:s:=strptr;strptr:=nextstr[s];
if strptr>maxstrptr then if strptr=maxstrings then begin strptr:=s;
docompaction(0);goto 20;
end else begin{if strsusedup<>maxstrptr then confusion(115);}
maxstrptr:=strptr;nextstr[strptr]:=maxstrptr+1;end;strref[s]:=1;
strstart[strptr]:=poolptr;strsusedup:=strsusedup+1;
{strsinuse:=strsinuse+1;
poolinuse:=poolinuse+(strstart[nextstr[s]]-strstart[s]);
if poolinuse>maxplused then maxplused:=poolinuse;
if strsinuse>maxstrsused then maxstrsused:=strsinuse;}makestring:=s;end;
{:46}{47:}procedure choplaststring(p:poolpointer);
begin{poolinuse:=poolinuse-(strstart[strptr]-p);};strstart[strptr]:=p;
end;{:47}{60:}function streqbuf(s:strnumber;k:integer):boolean;label 45;
var j:poolpointer;result:boolean;begin j:=strstart[s];
while j<strstart[nextstr[s]]do begin if strpool[j]<>buffer[k]then begin
result:=false;goto 45;end;j:=j+1;k:=k+1;end;result:=true;
45:streqbuf:=result;end;
{:60}{61:}function strvsstr(s,t:strnumber):integer;label 10;
var j,k:poolpointer;ls,lt:integer;l:integer;
begin ls:=(strstart[nextstr[s]]-strstart[s]);
lt:=(strstart[nextstr[t]]-strstart[t]);if ls<=lt then l:=ls else l:=lt;
j:=strstart[s];k:=strstart[t];
while l>0 do begin if strpool[j]<>strpool[k]then begin strvsstr:=strpool
[j]-strpool[k];goto 10;end;j:=j+1;k:=k+1;l:=l-1;end;strvsstr:=ls-lt;
10:end;{:61}{62:}function getstringsstarted:boolean;label 30,10;
var k,l:0..255;m,n:char;g:strnumber;a:integer;c:boolean;
begin poolptr:=0;strptr:=0;maxpoolptr:=0;maxstrptr:=0;strstart[0]:=0;
nextstr[0]:=1;stroverflowed:=false;{poolinuse:=0;strsinuse:=0;
maxplused:=0;maxstrsused:=0;[59:]pactcount:=0;pactchars:=0;
pactstrs:=0[:59];}strsusedup:=0;
{63:}for k:=0 to 255 do begin begin strpool[poolptr]:=k;
poolptr:=poolptr+1;end;g:=makestring;strref[g]:=127;end;{:63};
{66:}g:=loadpoolstrings((poolsize-stringvacancies));if g=0 then begin;
writeln(termout,'! You have to increase POOLSIZE.');
getstringsstarted:=false;goto 10;end;getstringsstarted:=true;{:66};
lastfixedstr:=strptr-1;fixedstruse:=strptr;10:end;
{:62}{79:}procedure printdd(n:integer);begin n:=abs(n)mod 100;
printchar(48+(n div 10));printchar(48+(n mod 10));end;
{:79}{80:}procedure terminput;var k:0..bufsize;begin break(termout);
if not inputln(termin,true)then fatalerror(262);termoffset:=0;
selector:=selector-1;
if last<>first then for k:=first to last-1 do print(buffer[k]);println;
buffer[last]:=37;selector:=selector+1;end;
{:80}{101:}procedure normalizeselector;
begin if logopened then selector:=10 else selector:=8;
if jobname=0 then openlogfile;
if interaction=0 then selector:=selector-1;end;
{:101}{107:}procedure pauseforinstructions;
begin if OKtointerrupt then begin interaction:=3;
if(selector=9)or(selector=7)then selector:=selector+1;
begin if interaction=3 then;printnl(263);print(297);end;
begin helpptr:=3;helpline[2]:=298;helpline[1]:=299;helpline[0]:=300;end;
deletionsallowed:=false;error;deletionsallowed:=true;interrupt:=0;end;
end;{:107}{108:}procedure missingerr(s:strnumber);
begin begin if interaction=3 then;printnl(263);print(301);end;print(s);
print(302);end;{:108}{113:}procedure cleararith;
begin begin if interaction=3 then;printnl(263);print(303);end;
begin helpptr:=4;helpline[3]:=304;helpline[2]:=305;helpline[1]:=306;
helpline[0]:=307;end;error;aritherror:=false;end;
{:113}{114:}function slowadd(x,y:integer):integer;
begin if x>=0 then if y<=2147483647-x then slowadd:=x+y else begin
aritherror:=true;slowadd:=2147483647;
end else if-y<=2147483647+x then slowadd:=x+y else begin aritherror:=
true;slowadd:=-2147483647;end;end;
{:114}{116:}function rounddecimals(k:smallnumber):scaled;var a:integer;
begin a:=0;while k>0 do begin k:=k-1;a:=(a+dig[k]*131072)div 10;end;
rounddecimals:=(a+1)div 2;end;
{:116}{121:}function makefraction(p,q:integer):fraction;var f:integer;
n:integer;negative:boolean;becareful:integer;
begin if p>=0 then negative:=false else begin p:=-p;negative:=true;end;
if q<=0 then begin{if q=0 then confusion(47);}q:=-q;
negative:=not negative;end;n:=p div q;p:=p mod q;
if n>=8 then begin aritherror:=true;
if negative then makefraction:=-2147483647 else makefraction:=2147483647
;end else begin n:=(n-1)*268435456;{122:}f:=1;repeat becareful:=p-q;
p:=becareful+p;if p>=0 then f:=f+f+1 else begin f:=f+f;p:=p+q;end;
until f>=268435456;becareful:=p-q;if becareful+p>=0 then f:=f+1{:122};
if negative then makefraction:=-(f+n)else makefraction:=f+n;end;end;
{:121}{123:}function takefraction(q:integer;f:fraction):integer;
var p:integer;negative:boolean;n:integer;becareful:integer;
begin{124:}if f>=0 then negative:=false else begin f:=-f;negative:=true;
end;if q<0 then begin q:=-q;negative:=not negative;end;{:124};
if f<268435456 then n:=0 else begin n:=f div 268435456;
f:=f mod 268435456;
if q<=2147483647 div n then n:=n*q else begin aritherror:=true;
n:=2147483647;end;end;f:=f+268435456;{125:}p:=134217728;
if q<1073741824 then repeat if odd(f)then p:=(p+q)div 2 else p:=(p)div 2
;f:=(f)div 2;
until f=1 else repeat if odd(f)then p:=p+(q-p)div 2 else p:=(p)div 2;
f:=(f)div 2;until f=1{:125};becareful:=n-2147483647;
if becareful+p>0 then begin aritherror:=true;n:=2147483647-p;end;
if negative then takefraction:=-(n+p)else takefraction:=n+p;end;
{:123}{126:}function takescaled(q:integer;f:scaled):integer;
var p:integer;negative:boolean;n:integer;becareful:integer;
begin{124:}if f>=0 then negative:=false else begin f:=-f;negative:=true;
end;if q<0 then begin q:=-q;negative:=not negative;end;{:124};
if f<65536 then n:=0 else begin n:=f div 65536;f:=f mod 65536;
if q<=2147483647 div n then n:=n*q else begin aritherror:=true;
n:=2147483647;end;end;f:=f+65536;{127:}p:=32768;
if q<1073741824 then repeat if odd(f)then p:=(p+q)div 2 else p:=(p)div 2
;f:=(f)div 2;
until f=1 else repeat if odd(f)then p:=p+(q-p)div 2 else p:=(p)div 2;
f:=(f)div 2;until f=1{:127};becareful:=n-2147483647;
if becareful+p>0 then begin aritherror:=true;n:=2147483647-p;end;
if negative then takescaled:=-(n+p)else takescaled:=n+p;end;
{:126}{128:}function makescaled(p,q:integer):scaled;var f:integer;
n:integer;negative:boolean;becareful:integer;
begin if p>=0 then negative:=false else begin p:=-p;negative:=true;end;
if q<=0 then begin{if q=0 then confusion(47);}q:=-q;
negative:=not negative;end;n:=p div q;p:=p mod q;
if n>=32768 then begin aritherror:=true;
if negative then makescaled:=-2147483647 else makescaled:=2147483647;
end else begin n:=(n-1)*65536;{129:}f:=1;repeat becareful:=p-q;
p:=becareful+p;if p>=0 then f:=f+f+1 else begin f:=f+f;p:=p+q;end;
until f>=65536;becareful:=p-q;if becareful+p>=0 then f:=f+1{:129};
if negative then makescaled:=-(f+n)else makescaled:=f+n;end;end;
{:128}{130:}function velocity(st,ct,sf,cf:fraction;t:scaled):fraction;
var acc,num,denom:integer;
begin acc:=takefraction(st-(sf div 16),sf-(st div 16));
acc:=takefraction(acc,ct-cf);num:=536870912+takefraction(acc,379625062);
denom:=805306368+takefraction(ct,497706707)+takefraction(cf,307599661);
if t<>65536 then num:=makescaled(num,t);
if num div 4>=denom then velocity:=1073741824 else velocity:=
makefraction(num,denom);end;
{:130}{131:}function abvscd(a,b,c,d:integer):integer;label 10;
var q,r:integer;begin{132:}if a<0 then begin a:=-a;b:=-b;end;
if c<0 then begin c:=-c;d:=-d;end;
if d<=0 then begin if b>=0 then if((a=0)or(b=0))and((c=0)or(d=0))then
begin abvscd:=0;goto 10;end else begin abvscd:=1;goto 10;end;
if d=0 then if a=0 then begin abvscd:=0;goto 10;
end else begin abvscd:=-1;goto 10;end;q:=a;a:=c;c:=q;q:=-b;b:=-d;d:=q;
end else if b<=0 then begin if b<0 then if a>0 then begin abvscd:=-1;
goto 10;end;if c=0 then begin abvscd:=0;goto 10;
end else begin abvscd:=-1;goto 10;end;end{:132};
while true do begin q:=a div d;r:=c div b;
if q<>r then if q>r then begin abvscd:=1;goto 10;
end else begin abvscd:=-1;goto 10;end;q:=a mod d;r:=c mod b;
if r=0 then if q=0 then begin abvscd:=0;goto 10;
end else begin abvscd:=1;goto 10;end;if q=0 then begin abvscd:=-1;
goto 10;end;a:=b;b:=q;c:=d;d:=r;end;10:end;
{:131}{133:}function floorscaled(x:scaled):scaled;var becareful:integer;
begin if x>=0 then floorscaled:=x-(x mod 65536)else begin becareful:=x+1
;floorscaled:=x+((-becareful)mod 65536)-65535;end;end;
function roundunscaled(x:scaled):integer;var becareful:integer;
begin if x>=32768 then roundunscaled:=1+((x-32768)div 65536)else if x>=
-32768 then roundunscaled:=0 else begin becareful:=x+1;
roundunscaled:=-(1+((-becareful-32768)div 65536));end;end;
function roundfraction(x:fraction):scaled;var becareful:integer;
begin if x>=2048 then roundfraction:=1+((x-2048)div 4096)else if x>=
-2048 then roundfraction:=0 else begin becareful:=x+1;
roundfraction:=-(1+((-becareful-2048)div 4096));end;end;
{:133}{135:}function squarert(x:scaled):scaled;var k:smallnumber;
y,q:integer;
begin if x<=0 then{136:}begin if x<0 then begin begin if interaction=3
then;printnl(263);print(308);end;printscaled(x);print(309);
begin helpptr:=2;helpline[1]:=310;helpline[0]:=311;end;error;end;
squarert:=0;end{:136}else begin k:=23;q:=2;
while x<536870912 do begin k:=k-1;x:=x+x+x+x;end;
if x<1073741824 then y:=0 else begin x:=x-1073741824;y:=1;end;
repeat{137:}x:=x+x;y:=y+y;if x>=1073741824 then begin x:=x-1073741824;
y:=y+1;end;x:=x+x;y:=y+y-q;q:=q+q;
if x>=1073741824 then begin x:=x-1073741824;y:=y+1;end;
if y>q then begin y:=y-q;q:=q+2;end else if y<=0 then begin q:=q-2;
y:=y+q;end;k:=k-1{:137};until k=0;squarert:=(q)div 2;end;end;
{:135}{138:}function pythadd(a,b:integer):integer;label 30;
var r:fraction;big:boolean;begin a:=abs(a);b:=abs(b);
if a<b then begin r:=b;b:=a;a:=r;end;
if b>0 then begin if a<536870912 then big:=false else begin a:=a div 4;
b:=b div 4;big:=true;end;{139:}while true do begin r:=makefraction(b,a);
r:=takefraction(r,r);if r=0 then goto 30;
r:=makefraction(r,1073741824+r);a:=a+takefraction(a+a,r);
b:=takefraction(b,r);end;30:{:139};
if big then if a<536870912 then a:=a+a+a+a else begin aritherror:=true;
a:=2147483647;end;end;pythadd:=a;end;
{:138}{140:}function pythsub(a,b:integer):integer;label 30;
var r:fraction;big:boolean;begin a:=abs(a);b:=abs(b);
if a<=b then{142:}begin if a<b then begin begin if interaction=3 then;
printnl(263);print(312);end;printscaled(a);print(313);printscaled(b);
print(309);begin helpptr:=2;helpline[1]:=310;helpline[0]:=311;end;error;
end;a:=0;
end{:142}else begin if a<1073741824 then big:=false else begin a:=(a)div
2;b:=(b)div 2;big:=true;end;
{141:}while true do begin r:=makefraction(b,a);r:=takefraction(r,r);
if r=0 then goto 30;r:=makefraction(r,1073741824-r);
a:=a-takefraction(a+a,r);b:=takefraction(b,r);end;30:{:141};
if big then a:=a+a;end;pythsub:=a;end;
{:140}{146:}function mlog(x:scaled):scaled;var y,z:integer;k:integer;
begin if x<=0 then{148:}begin begin if interaction=3 then;printnl(263);
print(314);end;printscaled(x);print(309);begin helpptr:=2;
helpline[1]:=315;helpline[0]:=311;end;error;mlog:=0;
end{:148}else begin y:=1302456860;z:=6581195;
while x<1073741824 do begin x:=x+x;y:=y-93032639;z:=z-48782;end;
y:=y+(z div 65536);k:=2;
while x>1073741828 do{147:}begin z:=((x-1)div twotothe[k])+1;
while x<1073741824+z do begin z:=(z+1)div 2;k:=k+1;end;y:=y+speclog[k];
x:=x-z;end{:147};mlog:=y div 8;end;end;
{:146}{149:}function mexp(x:scaled):scaled;var k:smallnumber;
y,z:integer;begin if x>174436200 then begin aritherror:=true;
mexp:=2147483647;
end else if x<-197694359 then mexp:=0 else begin if x<=0 then begin z:=
-8*x;y:=1048576;
end else begin if x<=127919879 then z:=1023359037-8*x else z:=8*(
174436200-x);y:=2147483647;end;{150:}k:=1;
while z>0 do begin while z>=speclog[k]do begin z:=z-speclog[k];
y:=y-1-((y-twotothe[k-1])div twotothe[k]);end;k:=k+1;end{:150};
if x<=127919879 then mexp:=(y+8)div 16 else mexp:=y;end;end;
{:149}{153:}function narg(x,y:integer):angle;var z:angle;t:integer;
k:smallnumber;octant:1..8;begin if x>=0 then octant:=1 else begin x:=-x;
octant:=2;end;if y<0 then begin y:=-y;octant:=octant+2;end;
if x<y then begin t:=y;y:=x;x:=t;octant:=octant+4;end;
if x=0 then{154:}begin begin if interaction=3 then;printnl(263);
print(316);end;begin helpptr:=2;helpline[1]:=317;helpline[0]:=311;end;
error;narg:=0;
end{:154}else begin{156:}while x>=536870912 do begin x:=(x)div 2;
y:=(y)div 2;end;z:=0;
if y>0 then begin while x<268435456 do begin x:=x+x;y:=y+y;end;
{157:}k:=0;repeat y:=y+y;k:=k+1;if y>x then begin z:=z+specatan[k];t:=x;
x:=x+(y div twotothe[k+k]);y:=y-t;end;until k=15;repeat y:=y+y;k:=k+1;
if y>x then begin z:=z+specatan[k];y:=y-x;end;until k=26{:157};
end{:156};{155:}case octant of 1:narg:=z;5:narg:=94371840-z;
6:narg:=94371840+z;2:narg:=188743680-z;4:narg:=z-188743680;
8:narg:=-z-94371840;7:narg:=z-94371840;3:narg:=-z;end{:155};end;end;
{:153}{159:}procedure nsincos(z:angle);var k:smallnumber;q:0..7;
r:fraction;x,y,t:integer;begin while z<0 do z:=z+377487360;
z:=z mod 377487360;q:=z div 47185920;z:=z mod 47185920;x:=268435456;
y:=x;if not odd(q)then z:=47185920-z;{161:}k:=1;
while z>0 do begin if z>=specatan[k]then begin z:=z-specatan[k];t:=x;
x:=t+y div twotothe[k];y:=y-t div twotothe[k];end;k:=k+1;end;
if y<0 then y:=0{:161};{160:}case q of 0:;1:begin t:=x;x:=y;y:=t;end;
2:begin t:=x;x:=-y;y:=t;end;3:x:=-x;4:begin x:=-x;y:=-y;end;
5:begin t:=x;x:=-y;y:=-t;end;6:begin t:=x;x:=y;y:=-t;end;7:y:=-y;
end{:160};r:=pythadd(x,y);ncos:=makefraction(x,r);
nsin:=makefraction(y,r);end;{:159}{163:}procedure newrandoms;
var k:0..54;x:fraction;
begin for k:=0 to 23 do begin x:=randoms[k]-randoms[k+31];
if x<0 then x:=x+268435456;randoms[k]:=x;end;
for k:=24 to 54 do begin x:=randoms[k]-randoms[k-24];
if x<0 then x:=x+268435456;randoms[k]:=x;end;jrandom:=54;end;
{:163}{164:}procedure initrandoms(seed:scaled);var j,jj,k:fraction;
i:0..54;begin j:=abs(seed);while j>=268435456 do j:=(j)div 2;k:=1;
for i:=0 to 54 do begin jj:=k;k:=j-k;j:=jj;if k<0 then k:=k+268435456;
randoms[(i*21)mod 55]:=j;end;newrandoms;newrandoms;newrandoms;end;
{:164}{165:}function unifrand(x:scaled):scaled;var y:scaled;
begin if jrandom=0 then newrandoms else jrandom:=jrandom-1;
y:=takefraction(abs(x),randoms[jrandom]);
if y=abs(x)then unifrand:=0 else if x>0 then unifrand:=y else unifrand:=
-y;end;{:165}{166:}function normrand:scaled;var x,u,l:integer;
begin repeat repeat if jrandom=0 then newrandoms else jrandom:=jrandom-1
;x:=takefraction(112429,randoms[jrandom]-134217728);
if jrandom=0 then newrandoms else jrandom:=jrandom-1;
u:=randoms[jrandom];until abs(x)<u;x:=makefraction(x,u);
l:=139548960-mlog(u);until abvscd(1024,l,x,x)>=0;normrand:=x;end;
{:166}{171:}{procedure printword(w:memoryword);begin printint(w.int);
printchar(32);printscaled(w.int);printchar(32);
printscaled(w.int div 4096);println;printint(w.hh.lh);printchar(61);
printint(w.hh.b0);printchar(58);printint(w.hh.b1);printchar(59);
printint(w.hh.rh);printchar(32);printint(w.qqqq.b0);printchar(58);
printint(w.qqqq.b1);printchar(58);printint(w.qqqq.b2);printchar(58);
printint(w.qqqq.b3);end;}{:171}{176:}{236:}procedure printcapsule;
forward;procedure showtokenlist(p,q:integer;l,nulltally:integer);
label 10;var class,c:smallnumber;r,v:integer;begin class:=3;
tally:=nulltally;
while(p<>0)and(tally<l)do begin if p=q then{602:}begin firstcount:=tally
;trickcount:=tally+1+errorline-halferrorline;
if trickcount<errorline then trickcount:=errorline;end{:602};{237:}c:=9;
if(p<0)or(p>memend)then begin print(521);goto 10;end;
if p<himemmin then{238:}if mem[p].hh.b1=20 then if mem[p].hh.b0=17 then
{239:}begin if class=0 then printchar(32);v:=mem[p+1].int;
if v<0 then begin if class=17 then printchar(32);printchar(91);
printscaled(v);printchar(93);c:=18;end else begin printscaled(v);c:=0;
end;
end{:239}else if mem[p].hh.b0<>4 then print(524)else begin printchar(34)
;print(mem[p+1].int);printchar(34);c:=4;
end else if(mem[p].hh.b1<>19)or(mem[p].hh.b0<1)or(mem[p].hh.b0>20)then
print(524)else begin gpointer:=p;printcapsule;c:=8;
end{:238}else begin r:=mem[p].hh.lh;
if r>=2372 then{241:}begin if r<2522 then begin print(526);r:=r-(2372);
end else if r<2672 then begin print(527);r:=r-(2522);
end else begin print(528);r:=r-(2672);end;printint(r);printchar(41);
c:=8;end{:241}else if r<1 then if r=0 then{240:}begin if class=17 then
printchar(32);print(525);c:=18;
end{:240}else print(522)else begin r:=hash[r].rh;
if(r<0)or(r>maxstrptr)then print(523)else{242:}begin c:=charclass[
strpool[strstart[r]]];if c=class then case c of 9:printchar(46);
5,6,7,8:;others:printchar(32)end;print(r);end{:242};end;end{:237};
class:=c;p:=mem[p].hh.rh;end;if p<>0 then print(520);10:end;
{:236}{626:}procedure runaway;
begin if scannerstatus>2 then begin printnl(683);
case scannerstatus of 3:print(684);4,5:print(685);6:print(686);end;
println;showtokenlist(mem[29998].hh.rh,0,errorline-10,0);end;end;
{:626}{:176}{177:}function getavail:halfword;var p:halfword;
begin p:=avail;
if p<>0 then avail:=mem[avail].hh.rh else if memend<memmax then begin
memend:=memend+1;p:=memend;end else begin himemmin:=himemmin-1;
p:=himemmin;if himemmin<=lomemmax then begin runaway;
overflow(318,memmax+1);end;end;mem[p].hh.rh:=0;{dynused:=dynused+1;}
getavail:=p;end;{:177}{181:}function getnode(s:integer):halfword;
label 40,10,20;var p:halfword;q:halfword;r:integer;t,tt:integer;
begin 20:p:=rover;repeat{183:}q:=p+mem[p].hh.lh;
while(mem[q].hh.rh=65535)do begin t:=mem[q+1].hh.rh;tt:=mem[q+1].hh.lh;
if q=rover then rover:=t;mem[t+1].hh.lh:=tt;mem[tt+1].hh.rh:=t;
q:=q+mem[q].hh.lh;end;r:=q-s;if r>p+1 then{184:}begin mem[p].hh.lh:=r-p;
rover:=p;goto 40;end{:184};
if r=p then if mem[p+1].hh.rh<>p then{185:}begin rover:=mem[p+1].hh.rh;
t:=mem[p+1].hh.lh;mem[rover+1].hh.lh:=t;mem[t+1].hh.rh:=rover;goto 40;
end{:185};mem[p].hh.lh:=q-p{:183};p:=mem[p+1].hh.rh;until p=rover;
if s=1073741824 then begin getnode:=65535;goto 10;end;
if lomemmax+2<himemmin then if lomemmax+2<=65535 then{182:}begin if
himemmin-lomemmax>=1998 then t:=lomemmax+1000 else t:=lomemmax+1+(
himemmin-lomemmax)div 2;if t>65535 then t:=65535;p:=mem[rover+1].hh.lh;
q:=lomemmax;mem[p+1].hh.rh:=q;mem[rover+1].hh.lh:=q;
mem[q+1].hh.rh:=rover;mem[q+1].hh.lh:=p;mem[q].hh.rh:=65535;
mem[q].hh.lh:=t-lomemmax;lomemmax:=t;mem[lomemmax].hh.rh:=0;
mem[lomemmax].hh.lh:=0;rover:=q;goto 20;end{:182};
overflow(318,memmax+1);40:mem[r].hh.rh:=0;{varused:=varused+s;}
getnode:=r;10:end;{:181}{186:}procedure freenode(p:halfword;s:halfword);
var q:halfword;begin mem[p].hh.lh:=s;mem[p].hh.rh:=65535;
q:=mem[rover+1].hh.lh;mem[p+1].hh.lh:=q;mem[p+1].hh.rh:=rover;
mem[rover+1].hh.lh:=p;mem[q+1].hh.rh:=p;{varused:=varused-s;}end;
{:186}{187:}procedure sortavail;var p,q,r:halfword;oldrover:halfword;
begin p:=getnode(1073741824);p:=mem[rover+1].hh.rh;
mem[rover+1].hh.rh:=65535;oldrover:=rover;
while p<>oldrover do{188:}if p<rover then begin q:=p;p:=mem[q+1].hh.rh;
mem[q+1].hh.rh:=rover;rover:=q;end else begin q:=rover;
while mem[q+1].hh.rh<p do q:=mem[q+1].hh.rh;r:=mem[p+1].hh.rh;
mem[p+1].hh.rh:=mem[q+1].hh.rh;mem[q+1].hh.rh:=p;p:=r;end{:188};
p:=rover;
while mem[p+1].hh.rh<>65535 do begin mem[mem[p+1].hh.rh+1].hh.lh:=p;
p:=mem[p+1].hh.rh;end;mem[p+1].hh.rh:=rover;mem[rover+1].hh.lh:=p;end;
{:187}{191:}procedure flushlist(p:halfword);label 30;var q,r:halfword;
begin if p>=himemmin then if p<>30000 then begin r:=p;repeat q:=r;
r:=mem[r].hh.rh;{dynused:=dynused-1;}if r<himemmin then goto 30;
until r=30000;30:mem[q].hh.rh:=avail;avail:=p;end;end;
procedure flushnodelist(p:halfword);var q:halfword;
begin while p<>0 do begin q:=p;p:=mem[p].hh.rh;
if q<himemmin then freenode(q,2)else begin mem[q].hh.rh:=avail;avail:=q;
{dynused:=dynused-1;}end;end;end;
{:191}{194:}{procedure checkmem(printlocs:boolean);label 31,32,33;
var p,q,r:halfword;clobbered:boolean;
begin for p:=0 to lomemmax do free[p]:=false;
for p:=himemmin to memend do free[p]:=false;[195:]p:=avail;q:=0;
clobbered:=false;
while p<>0 do begin if(p>memend)or(p<himemmin)then clobbered:=true else
if free[p]then clobbered:=true;if clobbered then begin printnl(319);
printint(q);goto 31;end;free[p]:=true;q:=p;p:=mem[q].hh.rh;end;
31:[:195];[196:]p:=rover;q:=0;clobbered:=false;
repeat if(p>=lomemmax)or(p<0)then clobbered:=true else if(mem[p+1].hh.rh
>=lomemmax)or(mem[p+1].hh.rh<0)then clobbered:=true else if not((mem[p].
hh.rh=65535))or(mem[p].hh.lh<2)or(p+mem[p].hh.lh>lomemmax)or(mem[mem[p+1
].hh.rh+1].hh.lh<>p)then clobbered:=true;
if clobbered then begin printnl(320);printint(q);goto 32;end;
for q:=p to p+mem[p].hh.lh-1 do begin if free[q]then begin printnl(321);
printint(q);goto 32;end;free[q]:=true;end;q:=p;p:=mem[p+1].hh.rh;
until p=rover;32:[:196];[197:]p:=0;
while p<=lomemmax do begin if(mem[p].hh.rh=65535)then begin printnl(322)
;printint(p);end;while(p<=lomemmax)and not free[p]do p:=p+1;
while(p<=lomemmax)and free[p]do p:=p+1;end[:197];[572:]q:=5;
p:=mem[q].hh.rh;
while p<>5 do begin if mem[p+1].hh.lh<>q then begin printnl(633);
printint(p);end;p:=mem[p+1].hh.rh;while true do begin r:=mem[p].hh.lh;
q:=p;p:=mem[q].hh.rh;if r=0 then goto 33;
if mem[mem[p].hh.lh+1].int>=mem[r+1].int then begin printnl(634);
printint(p);end;end;33:;end[:572];
if printlocs then[198:]begin[200:]q:=memmax;r:=memmax[:200];
printnl(323);
for p:=0 to lomemmax do if not free[p]and((p>waslomax)or wasfree[p])then
[199:]begin if p>q+1 then begin if q>r then begin print(324);
printint(q);end;printchar(32);printint(p);r:=p;end;q:=p;end[:199];
for p:=himemmin to memend do if not free[p]and((p<washimin)or(p>
wasmemend)or wasfree[p])then[199:]begin if p>q+1 then begin if q>r then
begin print(324);printint(q);end;printchar(32);printint(p);r:=p;end;
q:=p;end[:199];[201:]if q>r then begin print(324);printint(q);end[:201];
end[:198];for p:=0 to lomemmax do wasfree[p]:=free[p];
for p:=himemmin to memend do wasfree[p]:=free[p];wasmemend:=memend;
waslomax:=lomemmax;washimin:=himemmin;end;}
{:194}{202:}{procedure searchmem(p:halfword);var q:integer;
begin for q:=0 to lomemmax do begin if mem[q].hh.rh=p then begin printnl
(325);printint(q);printchar(41);end;
if mem[q].hh.lh=p then begin printnl(326);printint(q);printchar(41);end;
end;
for q:=himemmin to memend do begin if mem[q].hh.rh=p then begin printnl(
325);printint(q);printchar(41);end;
if mem[q].hh.lh=p then begin printnl(326);printint(q);printchar(41);end;
end;
[227:]for q:=1 to 2371 do begin if eqtb[q].rh=p then begin printnl(487);
printint(q);printchar(41);end;end[:227];end;}
{:202}{206:}procedure printop(c:quarterword);
begin if c<=16 then printtype(c)else case c of 30:print(351);
31:print(352);32:print(353);33:print(354);34:print(355);35:print(356);
36:print(357);37:print(358);38:print(359);39:print(360);40:print(361);
41:print(362);42:print(363);43:print(364);44:print(365);45:print(366);
46:print(367);47:print(368);48:print(369);49:print(370);50:print(371);
51:print(372);52:print(373);53:print(374);55:print(375);56:print(376);
57:print(377);58:print(378);59:print(379);60:print(380);61:print(381);
62:print(382);63:print(383);64:print(384);65:print(385);66:print(386);
67:print(387);68:print(388);54:print(389);69:print(390);70:print(391);
71:print(392);72:print(393);73:print(394);74:print(395);75:print(396);
76:print(397);77:print(398);78:print(399);79:print(400);80:print(401);
81:print(402);82:print(403);83:print(404);84:print(405);85:print(406);
86:print(407);87:print(408);88:print(409);89:print(410);90:print(411);
91:print(412);92:print(413);93:print(414);94:print(415);
95:printchar(43);96:printchar(45);97:printchar(42);98:printchar(47);
99:print(416);100:print(313);101:print(417);102:print(418);
103:printchar(60);104:print(419);105:printchar(62);106:print(420);
107:printchar(61);108:print(421);109:print(38);110:print(422);
111:print(423);112:print(424);113:print(425);114:print(426);
115:print(427);116:print(428);117:print(429);118:print(430);
119:print(431);121:print(432);122:print(433);123:print(434);
124:print(435);125:print(436);126:print(437);127:print(438);
128:print(439);129:print(440);others:print(324)end;end;
{:206}{212:}procedure fixdateandtime;begin internal[16]:=12*60*65536;
internal[15]:=4*65536;internal[14]:=7*65536;internal[13]:=1776*65536;
end;{:212}{223:}function idlookup(j,l:integer):halfword;label 40;
var h:integer;p:halfword;k:halfword;
begin if l=1 then{224:}begin p:=buffer[j]+1;hash[p].rh:=p-1;goto 40;
end{:224};{226:}h:=buffer[j];
for k:=j+1 to j+l-1 do begin h:=h+h+buffer[k];
while h>=1777 do h:=h-1777;end{:226};p:=h+257;
while true do begin if hash[p].rh>0 then if(strstart[nextstr[hash[p].rh]
]-strstart[hash[p].rh])=l then if streqbuf(hash[p].rh,j)then goto 40;
if hash[p].lh=0 then{225:}begin if hash[p].rh>0 then begin repeat if(
hashused=257)then overflow(486,2100);hashused:=hashused-1;
until hash[hashused].rh=0;hash[p].lh:=hashused;p:=hashused;end;
begin if poolptr+l>maxpoolptr then if poolptr+l>poolsize then
docompaction(l)else maxpoolptr:=poolptr+l;end;
for k:=j to j+l-1 do begin strpool[poolptr]:=buffer[k];
poolptr:=poolptr+1;end;hash[p].rh:=makestring;strref[hash[p].rh]:=127;
{stcount:=stcount+1;}goto 40;end{:225};p:=hash[p].lh;end;40:idlookup:=p;
end;{:223}{228:}procedure primitive(s:strnumber;c:halfword;o:halfword);
var k:poolpointer;j:smallnumber;l:smallnumber;begin k:=strstart[s];
l:=strstart[nextstr[s]]-k;for j:=0 to l-1 do buffer[j]:=strpool[k+j];
cursym:=idlookup(0,l);if s>=256 then begin flushstring(hash[cursym].rh);
hash[cursym].rh:=s;end;eqtb[cursym].lh:=c;eqtb[cursym].rh:=o;end;
{:228}{234:}function newnumtok(v:scaled):halfword;var p:halfword;
begin p:=getnode(2);mem[p+1].int:=v;mem[p].hh.b0:=17;mem[p].hh.b1:=20;
newnumtok:=p;end;{:234}{235:}procedure tokenrecycle;forward;
procedure flushtokenlist(p:halfword);var q:halfword;
begin while p<>0 do begin q:=p;p:=mem[p].hh.rh;
if q>=himemmin then begin mem[q].hh.rh:=avail;avail:=q;
{dynused:=dynused-1;}end else begin case mem[q].hh.b0 of 1,2,17:;
4:begin if strref[mem[q+1].int]<127 then if strref[mem[q+1].int]>1 then
strref[mem[q+1].int]:=strref[mem[q+1].int]-1 else flushstring(mem[q+1].
int);end;3,5,7,11,9,6,8,10,15,13,14,12,18,19,20:begin gpointer:=q;
tokenrecycle;end;others:confusion(519)end;freenode(q,2);end;end;end;
{:235}{245:}procedure deletemacref(p:halfword);
begin if mem[p].hh.lh=0 then flushtokenlist(p)else mem[p].hh.lh:=mem[p].
hh.lh-1;end;{:245}{246:}{580:}procedure printcmdmod(c,m:integer);
begin case c of{230:}20:print(491);76:print(490);61:print(492);
78:print(489);34:print(493);80:print(58);81:print(44);59:print(494);
62:print(495);29:print(496);79:print(488);83:print(482);28:print(497);
9:print(498);12:print(499);15:print(500);48:print(123);65:print(91);
16:print(501);17:print(502);70:print(503);49:print(324);26:print(504);
10:printchar(92);67:print(125);66:print(93);14:print(505);11:print(506);
82:print(59);19:print(507);77:print(508);
30:if m=2 then print(511)else if m=1 then print(510)else print(509);
72:print(512);37:print(513);60:print(514);71:print(515);73:print(516);
74:print(517);31:print(518);
{:230}{649:}1:if m=0 then print(706)else print(707);2:print(479);
3:print(480);
{:649}{657:}18:if m<=2 then if m=1 then print(720)else if m<1 then print
(483)else print(721)else if m=55 then print(722)else if m=46 then print(
723)else print(724);
7:if m<=1 then if m=1 then print(727)else print(484)else if m=2372 then
print(725)else print(726);{:657}{662:}63:case m of 1:print(729);
2:printchar(64);3:print(730);others:print(728)end;
{:662}{669:}58:if m>=2372 then if m=2372 then print(741)else if m=2522
then print(742)else print(743)else if m<2 then print(744)else if m=2
then print(745)else print(746);
{:669}{683:}6:if m=0 then print(756)else print(653);
{:683}{714:}4,5:case m of 1:print(783);2:print(481);3:print(784);
others:print(785)end;
{:714}{883:}35,36,39,57,47,52,38,45,56,50,53,54:printop(m);
{:883}{1036:}32:printtype(m);
{:1036}{1041:}84:if m=0 then print(991)else print(992);
{:1041}{1047:}25:case m of 0:print(275);1:print(276);2:print(277);
others:print(998)end;
{:1047}{1050:}23:if m=0 then print(999)else print(1000);
{:1050}{1060:}24:case m of 0:print(1014);1:print(1015);2:print(1016);
3:print(1017);others:print(1018)end;
{:1060}{1065:}33,64:begin if c=33 then print(1021)else print(1022);
print(1023);print(hash[m].rh);end;
43:if m=0 then print(1024)else print(1025);13:print(1026);
55,46,51:begin printcmdmod(18,c);print(1027);println;
showtokenlist(mem[mem[m].hh.rh].hh.rh,0,1000,0);end;8:print(1028);
42:print(intname[m]);
{:1065}{1076:}69:if m=1 then print(1038)else if m=0 then print(1037)else
print(1039);
68:if m=6 then print(1040)else if m=11 then print(1042)else if m=13 then
print(1043)else if m=1 then print(1044)else if m=5 then print(1047)else
if m=9 then print(1046)else if m=7 then print(1048)else if m=3 then
print(1045)else print(1041);
{:1076}{1098:}21:if m=4 then print(1062)else print(1063);
{:1098}{1118:}27:if m<1 then print(1076)else if m=1 then print(1077)else
if m=3 then print(1079)else print(1078);
{:1118}{1147:}22:case m of 0:print(1094);1:print(1095);2:print(1096);
3:print(1097);others:print(1098)end;
{:1147}{1154:}75:case m of 0:print(1116);1:print(1117);2:print(1119);
3:print(1121);5:print(1118);6:print(1120);7:print(1122);11:print(1123);
others:print(1124)end;{:1154}others:print(638)end;end;
{:580}procedure showmacro(p:halfword;q,l:integer);label 10;
var r:halfword;begin p:=mem[p].hh.rh;
while mem[p].hh.lh>7 do begin r:=mem[p].hh.rh;mem[p].hh.rh:=0;
showtokenlist(p,0,l,0);mem[p].hh.rh:=r;p:=r;
if l>0 then l:=l-tally else goto 10;end;tally:=0;
case mem[p].hh.lh of 0:print(529);1,2,3:begin printchar(60);
printcmdmod(58,mem[p].hh.lh);print(530);end;4:print(531);5:print(532);
6:print(533);7:print(534);end;showtokenlist(mem[p].hh.rh,q,l-tally,0);
10:end;{:246}{251:}procedure initbignode(p:halfword);var q:halfword;
s:smallnumber;begin s:=bignodesize[mem[p].hh.b0];q:=getnode(s);
repeat s:=s-2;
{541:}begin if serialno=2147483584 then overflow(623,33554431);
mem[q+s].hh.b0:=20;serialno:=serialno+64;mem[q+s+1].int:=serialno;
end{:541};mem[q+s].hh.b1:=(s)div 2+sector0[mem[p].hh.b0];
mem[q+s].hh.rh:=0;until s=0;mem[q].hh.rh:=p;mem[p+1].int:=q;end;
{:251}{252:}function idtransform:halfword;var p,q,r:halfword;
begin p:=getnode(2);mem[p].hh.b0:=12;mem[p].hh.b1:=19;mem[p+1].int:=0;
initbignode(p);q:=mem[p+1].int;r:=q+12;repeat r:=r-2;mem[r].hh.b0:=17;
mem[r+1].int:=0;until r=q;mem[q+5].int:=65536;mem[q+11].int:=65536;
idtransform:=p;end;{:252}{253:}procedure newroot(x:halfword);
var p:halfword;begin p:=getnode(2);mem[p].hh.b0:=0;mem[p].hh.b1:=0;
mem[p].hh.rh:=x;eqtb[x].rh:=p;end;
{:253}{254:}procedure printvariablename(p:halfword);label 40,10;
var q:halfword;r:halfword;
begin while mem[p].hh.b1>=5 do{256:}begin case mem[p].hh.b1 of 5:
printchar(120);6:printchar(121);7:print(537);8:print(538);9:print(539);
10:print(540);11:print(541);12:print(542);13:print(543);14:print(544);
15:print(545);16:print(546);17:print(547);18:print(548);
19:begin print(549);printint(p-0);goto 10;end;end;print(550);
p:=mem[p-sectoroffset[mem[p].hh.b1]].hh.rh;end{:256};q:=0;
while mem[p].hh.b1>1 do{255:}begin if mem[p].hh.b1=3 then begin r:=
newnumtok(mem[p+2].int);repeat p:=mem[p].hh.rh;until mem[p].hh.b1=4;
end else if mem[p].hh.b1=2 then begin p:=mem[p].hh.rh;goto 40;
end else begin if mem[p].hh.b1<>4 then confusion(536);r:=getavail;
mem[r].hh.lh:=mem[p+2].hh.lh;end;mem[r].hh.rh:=q;q:=r;
40:p:=mem[p+2].hh.rh;end{:255};r:=getavail;mem[r].hh.lh:=mem[p].hh.rh;
mem[r].hh.rh:=q;if mem[p].hh.b1=1 then print(535);
showtokenlist(r,0,2147483647,tally);flushtokenlist(r);10:end;
{:254}{257:}function interesting(p:halfword):boolean;var t:smallnumber;
begin if internal[3]>0 then interesting:=true else begin t:=mem[p].hh.b1
;if t>=5 then if t<>19 then t:=mem[mem[p-sectoroffset[t]].hh.rh].hh.b1;
interesting:=(t<>19);end;end;
{:257}{258:}function newstructure(p:halfword):halfword;var q,r:halfword;
begin case mem[p].hh.b1 of 0:begin q:=mem[p].hh.rh;r:=getnode(2);
eqtb[q].rh:=r;end;3:{259:}begin q:=p;repeat q:=mem[q].hh.rh;
until mem[q].hh.b1=4;q:=mem[q+2].hh.rh;r:=q+1;repeat q:=r;
r:=mem[r].hh.rh;until r=p;r:=getnode(3);mem[q].hh.rh:=r;
mem[r+2].int:=mem[p+2].int;end{:259};4:{260:}begin q:=mem[p+2].hh.rh;
r:=mem[q+1].hh.lh;repeat q:=r;r:=mem[r].hh.rh;until r=p;r:=getnode(3);
mem[q].hh.rh:=r;mem[r+2]:=mem[p+2];
if mem[p+2].hh.lh=0 then begin q:=mem[p+2].hh.rh+1;
while mem[q].hh.rh<>p do q:=mem[q].hh.rh;mem[q].hh.rh:=r;end;end{:260};
others:confusion(551)end;mem[r].hh.rh:=mem[p].hh.rh;mem[r].hh.b0:=22;
mem[r].hh.b1:=mem[p].hh.b1;mem[r+1].hh.lh:=p;mem[p].hh.b1:=2;
q:=getnode(3);mem[p].hh.rh:=q;mem[r+1].hh.rh:=q;mem[q+2].hh.rh:=r;
mem[q].hh.b0:=0;mem[q].hh.b1:=4;mem[q].hh.rh:=9;mem[q+2].hh.lh:=0;
newstructure:=r;end;
{:258}{261:}function findvariable(t:halfword):halfword;label 10;
var p,q,r,s:halfword;pp,qq,rr,ss:halfword;n:integer;saveword:memoryword;
begin p:=mem[t].hh.lh;t:=mem[t].hh.rh;
if eqtb[p].lh mod 85<>43 then begin findvariable:=0;goto 10;end;
if eqtb[p].rh=0 then newroot(p);p:=eqtb[p].rh;pp:=p;
while t<>0 do begin{262:}if mem[pp].hh.b0<>22 then begin if mem[pp].hh.
b0>22 then begin findvariable:=0;goto 10;end;ss:=newstructure(pp);
if p=pp then p:=ss;pp:=ss;end;
if mem[p].hh.b0<>22 then p:=newstructure(p){:262};
if t<himemmin then{263:}begin n:=mem[t+1].int;
pp:=mem[mem[pp+1].hh.lh].hh.rh;q:=mem[mem[p+1].hh.lh].hh.rh;
saveword:=mem[q+2];mem[q+2].int:=2147483647;s:=p+1;repeat r:=s;
s:=mem[s].hh.rh;until n<=mem[s+2].int;
if n=mem[s+2].int then p:=s else begin p:=getnode(3);mem[r].hh.rh:=p;
mem[p].hh.rh:=s;mem[p+2].int:=n;mem[p].hh.b1:=3;mem[p].hh.b0:=0;end;
mem[q+2]:=saveword;end{:263}else{264:}begin n:=mem[t].hh.lh;
ss:=mem[pp+1].hh.lh;repeat rr:=ss;ss:=mem[ss].hh.rh;
until n<=mem[ss+2].hh.lh;if n<mem[ss+2].hh.lh then begin qq:=getnode(3);
mem[rr].hh.rh:=qq;mem[qq].hh.rh:=ss;mem[qq+2].hh.lh:=n;mem[qq].hh.b1:=4;
mem[qq].hh.b0:=0;mem[qq+2].hh.rh:=pp;ss:=qq;end;
if p=pp then begin p:=ss;pp:=ss;end else begin pp:=ss;s:=mem[p+1].hh.lh;
repeat r:=s;s:=mem[s].hh.rh;until n<=mem[s+2].hh.lh;
if n=mem[s+2].hh.lh then p:=s else begin q:=getnode(3);mem[r].hh.rh:=q;
mem[q].hh.rh:=s;mem[q+2].hh.lh:=n;mem[q].hh.b1:=4;mem[q].hh.b0:=0;
mem[q+2].hh.rh:=p;p:=q;end;end;end{:264};t:=mem[t].hh.rh;end;
if mem[pp].hh.b0>=22 then if mem[pp].hh.b0=22 then pp:=mem[pp+1].hh.lh
else begin findvariable:=0;goto 10;end;
if mem[p].hh.b0=22 then p:=mem[p+1].hh.lh;
if mem[p].hh.b0=0 then begin if mem[pp].hh.b0=0 then begin mem[pp].hh.b0
:=16;mem[pp+1].int:=0;end;mem[p].hh.b0:=mem[pp].hh.b0;mem[p+1].int:=0;
end;findvariable:=p;10:end;
{:261}{265:}{277:}procedure prpath(h:halfword);label 30,31;
var p,q:halfword;begin p:=h;repeat q:=mem[p].hh.rh;
if(p=0)or(q=0)then begin printnl(261);goto 30;end;
{278:}printtwo(mem[p+1].int,mem[p+2].int);
case mem[p].hh.b1 of 0:begin if mem[p].hh.b0=4 then print(553);
if(mem[q].hh.b0<>0)or(q<>h)then q:=0;goto 31;end;
1:{281:}begin print(559);printtwo(mem[p+5].int,mem[p+6].int);print(558);
if mem[q].hh.b0<>1 then print(560)else printtwo(mem[q+3].int,mem[q+4].
int);goto 31;end{:281};
4:{282:}if(mem[p].hh.b0<>1)and(mem[p].hh.b0<>4)then print(553){:282};
3,2:{283:}begin if mem[p].hh.b0=4 then print(560);
if mem[p].hh.b1=3 then begin print(556);printscaled(mem[p+5].int);
end else begin nsincos(mem[p+5].int);printchar(123);printscaled(ncos);
printchar(44);printscaled(nsin);end;printchar(125);end{:283};
others:print(261)end;
if mem[q].hh.b0<=1 then print(554)else if(mem[p+6].int<>65536)or(mem[q+4
].int<>65536)then{280:}begin print(557);
if mem[p+6].int<0 then print(492);printscaled(abs(mem[p+6].int));
if mem[p+6].int<>mem[q+4].int then begin print(558);
if mem[q+4].int<0 then print(492);printscaled(abs(mem[q+4].int));end;
end{:280};31:{:278};p:=q;
if(p<>h)or(mem[h].hh.b0<>0)then{279:}begin printnl(555);
if mem[p].hh.b0=2 then begin nsincos(mem[p+3].int);printchar(123);
printscaled(ncos);printchar(44);printscaled(nsin);printchar(125);
end else if mem[p].hh.b0=3 then begin print(556);
printscaled(mem[p+3].int);printchar(125);end;end{:279};until p=h;
if mem[h].hh.b0<>0 then print(410);30:end;
{:277}{284:}procedure printpath(h:halfword;s:strnumber;nuline:boolean);
begin printdiagnostic(561,s,nuline);println;prpath(h);
enddiagnostic(true);end;{:284}{364:}procedure prpen(h:halfword);
label 30;var p,q:halfword;
begin if(h=mem[h].hh.rh)then{366:}begin print(570);
printscaled(mem[h+1].int);printchar(44);printscaled(mem[h+2].int);
printchar(44);printscaled(mem[h+3].int-mem[h+1].int);printchar(44);
printscaled(mem[h+5].int-mem[h+1].int);printchar(44);
printscaled(mem[h+4].int-mem[h+2].int);printchar(44);
printscaled(mem[h+6].int-mem[h+2].int);printchar(41);
end{:366}else begin p:=h;repeat printtwo(mem[p+1].int,mem[p+2].int);
printnl(569);{365:}q:=mem[p].hh.rh;
if(q=0)or(mem[q].hh.lh<>p)then begin printnl(261);goto 30;end;
p:=q{:365};until p=h;print(410);end;30:end;
{:364}{367:}procedure printpen(h:halfword;s:strnumber;nuline:boolean);
begin printdiagnostic(571,s,nuline);println;prpen(h);
enddiagnostic(true);end;
{:367}{418:}{398:}function sqrtdet(a,b,c,d:scaled):scaled;
var maxabs:scaled;s:integer;begin{399:}maxabs:=abs(a);
if abs(b)>maxabs then maxabs:=abs(b);
if abs(c)>maxabs then maxabs:=abs(c);
if abs(d)>maxabs then maxabs:=abs(d){:399};s:=64;
while(maxabs<268435456)and(s>1)do begin a:=a+a;b:=b+b;c:=c+c;d:=d+d;
maxabs:=maxabs+maxabs;s:=(s)div 2;end;
sqrtdet:=s*squarert(abs(takefraction(a,d)-takefraction(b,c)));end;
function getpenscale(p:halfword):scaled;
begin getpenscale:=sqrtdet(mem[p+3].int-mem[p+1].int,mem[p+5].int-mem[p
+1].int,mem[p+4].int-mem[p+2].int,mem[p+6].int-mem[p+2].int);end;
{:398}{422:}{423:}procedure printcompactnode(p:halfword;k:smallnumber);
var q:halfword;begin q:=p+k-1;printchar(40);
while p<=q do begin printscaled(mem[p].int);if p<q then printchar(44);
p:=p+1;end;printchar(41);end;{:423}procedure printobjcolor(p:halfword);
begin if mem[p+2].hh.b0=3 then if mem[p+3].int>0 then begin print(586);
printcompactnode(p+3,1);
end else if mem[p+2].hh.b0=7 then if(mem[p+3].int>0)or(mem[p+4].int>0)or
(mem[p+5].int>0)or(mem[p+6].int>0)then begin print(587);
printcompactnode(p+3,4);
end else if mem[p+2].hh.b0=5 then if(mem[p+3].int>0)or(mem[p+4].int>0)or
(mem[p+5].int>0)then begin print(588);printcompactnode(p+3,3);end;end;
{:422}{426:}function dashoffset(h:halfword):scaled;var x:scaled;
begin if(mem[h].hh.rh=2)or(mem[h+1].int<0)then confusion(596);
if mem[h+1].int=0 then x:=0 else begin x:=-(mem[mem[h].hh.rh+1].int mod
mem[h+1].int);if x<0 then x:=x+mem[h+1].int;end;dashoffset:=x;end;
{:426}procedure printedges(h:halfword;s:strnumber;nuline:boolean);
var p:halfword;hh,pp:halfword;scf:scaled;oktodash:boolean;
begin printdiagnostic(573,s,nuline);p:=h+7;
while mem[p].hh.rh<>0 do begin p:=mem[p].hh.rh;println;
case mem[p].hh.b0 of{419:}1:begin print(576);printobjcolor(p);
printchar(58);println;prpath(mem[p+1].hh.rh);println;
if(mem[p+1].hh.lh<>0)then begin{420:}case mem[p].hh.b1 of 0:begin print(
578);printscaled(mem[p+7].int);end;1:print(579);2:print(580);
others:print(581);end{:420};print(577);println;prpen(mem[p+1].hh.lh);
end;end;{:419}{424:}2:begin print(589);printobjcolor(p);printchar(58);
println;prpath(mem[p+1].hh.rh);
if mem[p+9].hh.rh<>0 then begin printnl(590);
{425:}oktodash:=(mem[p+1].hh.lh=mem[mem[p+1].hh.lh].hh.rh);
if not oktodash then scf:=65536 else scf:=mem[p+10].int;
hh:=mem[p+9].hh.rh;pp:=mem[hh].hh.rh;
if(pp=2)or(mem[hh+1].int<0)then print(591)else begin mem[3].int:=mem[pp
+1].int+mem[hh+1].int;while pp<>2 do begin print(592);
printscaled(takescaled(mem[pp+2].int-mem[pp+1].int,scf));print(593);
printscaled(takescaled(mem[mem[pp].hh.rh+1].int-mem[pp+2].int,scf));
pp:=mem[pp].hh.rh;if pp<>2 then printchar(32);end;print(594);
printscaled(-takescaled(dashoffset(hh),scf));
if not oktodash or(mem[hh+1].int=0)then print(595);end{:425};end;
println;{421:}case mem[p+9].hh.b0 of 0:print(582);1:print(583);
2:print(584);others:print(560)end;print(585);
{420:}case mem[p].hh.b1 of 0:begin print(578);printscaled(mem[p+7].int);
end;1:print(579);2:print(580);others:print(581);end{:420}{:421};
print(577);println;
if mem[p+1].hh.lh=0 then print(261)else prpen(mem[p+1].hh.lh);end;
{:424}{427:}3:begin printchar(34);print(mem[p+1].hh.rh);print(597);
print(fontname[mem[p+1].hh.lh]);printchar(34);println;printobjcolor(p);
print(598);printcompactnode(p+11,6);end;{:427}{428:}4:begin print(599);
println;prpath(mem[p+1].hh.rh);end;6:print(600);
{:428}{429:}5:begin print(601);println;prpath(mem[p+1].hh.rh);end;
7:print(602);{:429}others:begin print(574);end end;end;printnl(575);
if p<>mem[h+7].hh.lh then print(63);enddiagnostic(true);end;
{:418}{544:}procedure printdependency(p:halfword;t:smallnumber);
label 10;var v:integer;pp,q:halfword;begin pp:=p;
while true do begin v:=abs(mem[p+1].int);q:=mem[p].hh.lh;
if q=0 then begin if(v<>0)or(p=pp)then begin if mem[p+1].int>0 then if p
<>pp then printchar(43);printscaled(mem[p+1].int);end;goto 10;end;
{545:}if mem[p+1].int<0 then printchar(45)else if p<>pp then printchar(
43);if t=18 then v:=roundfraction(v);
if v<>65536 then printscaled(v){:545};
if mem[q].hh.b0<>20 then confusion(624);printvariablename(q);
v:=mem[q+1].int mod 64;while v>0 do begin print(625);v:=v-2;end;
p:=mem[p].hh.rh;end;10:end;
{:544}{790:}{794:}procedure printdp(t:smallnumber;p:halfword;
verbosity:smallnumber);var q:halfword;begin q:=mem[p].hh.rh;
if(mem[q].hh.lh=0)or(verbosity>0)then printdependency(p,t)else print(841
);end;{:794}{788:}function stashcurexp:halfword;var p:halfword;
begin case curtype of 3,5,7,11,9,12,13,15,18,19,20,14:p:=curexp;
others:begin p:=getnode(2);mem[p].hh.b1:=19;mem[p].hh.b0:=curtype;
mem[p+1].int:=curexp;end end;curtype:=1;mem[p].hh.rh:=1;stashcurexp:=p;
end;{:788}{789:}procedure unstashcurexp(p:halfword);
begin curtype:=mem[p].hh.b0;
case curtype of 3,5,7,11,9,12,13,15,18,19,20,14:curexp:=p;
others:begin curexp:=mem[p+1].int;freenode(p,2);end end;end;
{:789}procedure printexp(p:halfword;verbosity:smallnumber);
var restorecurexp:boolean;t:smallnumber;v:integer;q:halfword;
begin if p<>0 then restorecurexp:=false else begin p:=stashcurexp;
restorecurexp:=true;end;t:=mem[p].hh.b0;
if t<18 then v:=mem[p+1].int else if t<20 then v:=mem[p+1].hh.rh;
{791:}case t of 1:print(327);2:if v=30 then print(351)else print(352);
3,5,7,11,9,16:{795:}begin printtype(t);if v<>0 then begin printchar(32);
while(mem[v].hh.b1=19)and(v<>p)do v:=mem[v+1].int;printvariablename(v);
end;end{:795};4:begin printchar(34);print(v);printchar(34);end;
6,8,10:{793:}if verbosity<=1 then printtype(t)else begin if selector=10
then if internal[12]<=0 then begin selector:=8;printtype(t);print(840);
selector:=10;end;case t of 6:printpen(v,287,false);
8:printpath(v,287,false);10:printedges(v,287,false);end;end{:793};
12,13,15,14:if v=0 then printtype(t)else{792:}begin printchar(40);
q:=v+bignodesize[t];
repeat if mem[v].hh.b0=17 then printscaled(mem[v+1].int)else if mem[v].
hh.b0=20 then printvariablename(v)else printdp(mem[v].hh.b0,mem[v+1].hh.
rh,verbosity);v:=v+2;if v<>q then printchar(44);until v=q;printchar(41);
end{:792};17:printscaled(v);18,19:printdp(t,v,verbosity);
20:printvariablename(p);others:confusion(839)end{:791};
if restorecurexp then unstashcurexp(p);end;
{:790}{796:}procedure disperr(p:halfword;s:strnumber);
begin if interaction=3 then;printnl(832);printexp(p,1);
if s<>287 then begin printnl(263);print(s);end;end;
{:796}{549:}function pplusfq(p:halfword;f:integer;q:halfword;
t,tt:smallnumber):halfword;label 30;var pp,qq:halfword;r,s:halfword;
threshold:integer;v:integer;
begin if t=18 then threshold:=2685 else threshold:=8;r:=29999;
pp:=mem[p].hh.lh;qq:=mem[q].hh.lh;
while true do if pp=qq then if pp=0 then goto 30 else{550:}begin if tt=
18 then v:=mem[p+1].int+takefraction(f,mem[q+1].int)else v:=mem[p+1].int
+takescaled(f,mem[q+1].int);mem[p+1].int:=v;s:=p;p:=mem[p].hh.rh;
if abs(v)<threshold then freenode(s,2)else begin if abs(v)>=626349397
then if watchcoefs then begin mem[qq].hh.b0:=0;fixneeded:=true;end;
mem[r].hh.rh:=s;r:=s;end;pp:=mem[p].hh.lh;q:=mem[q].hh.rh;
qq:=mem[q].hh.lh;
end{:550}else if mem[pp+1].int<mem[qq+1].int then{551:}begin if tt=18
then v:=takefraction(f,mem[q+1].int)else v:=takescaled(f,mem[q+1].int);
if abs(v)>(threshold)div 2 then begin s:=getnode(2);mem[s].hh.lh:=qq;
mem[s+1].int:=v;
if abs(v)>=626349397 then if watchcoefs then begin mem[qq].hh.b0:=0;
fixneeded:=true;end;mem[r].hh.rh:=s;r:=s;end;q:=mem[q].hh.rh;
qq:=mem[q].hh.lh;end{:551}else begin mem[r].hh.rh:=p;r:=p;
p:=mem[p].hh.rh;pp:=mem[p].hh.lh;end;
30:if t=18 then mem[p+1].int:=slowadd(mem[p+1].int,takefraction(mem[q+1]
.int,f))else mem[p+1].int:=slowadd(mem[p+1].int,takescaled(mem[q+1].int,
f));mem[r].hh.rh:=p;depfinal:=p;pplusfq:=mem[29999].hh.rh;end;
{:549}{555:}function poverv(p:halfword;v:scaled;
t0,t1:smallnumber):halfword;var r,s:halfword;w:integer;
threshold:integer;scalingdown:boolean;
begin if t0<>t1 then scalingdown:=true else scalingdown:=false;
if t1=18 then threshold:=1342 else threshold:=4;r:=29999;
while mem[p].hh.lh<>0 do begin if scalingdown then if abs(v)<524288 then
w:=makescaled(mem[p+1].int,v*4096)else w:=makescaled(roundfraction(mem[p
+1].int),v)else w:=makescaled(mem[p+1].int,v);
if abs(w)<=threshold then begin s:=mem[p].hh.rh;freenode(p,2);p:=s;
end else begin if abs(w)>=626349397 then begin fixneeded:=true;
mem[mem[p].hh.lh].hh.b0:=0;end;mem[r].hh.rh:=p;r:=p;mem[p+1].int:=w;
p:=mem[p].hh.rh;end;end;mem[r].hh.rh:=p;
mem[p+1].int:=makescaled(mem[p+1].int,v);poverv:=mem[29999].hh.rh;end;
{:555}{557:}procedure valtoobig(x:scaled);
begin if internal[30]>0 then begin begin if interaction=3 then;
printnl(263);print(626);end;printscaled(x);printchar(41);
begin helpptr:=4;helpline[3]:=627;helpline[2]:=628;helpline[1]:=629;
helpline[0]:=630;end;error;end;end;
{:557}{558:}procedure makeknown(p,q:halfword);var t:18..19;
begin mem[mem[q].hh.rh+1].hh.lh:=mem[p+1].hh.lh;
mem[mem[p+1].hh.lh].hh.rh:=mem[q].hh.rh;t:=mem[p].hh.b0;
mem[p].hh.b0:=17;mem[p+1].int:=mem[q+1].int;freenode(q,2);
if abs(mem[p+1].int)>=268435456 then valtoobig(mem[p+1].int);
if internal[2]>0 then if interesting(p)then begin begindiagnostic;
printnl(631);printvariablename(p);printchar(61);
printscaled(mem[p+1].int);enddiagnostic(false);end;
if curexp=p then if curtype=t then begin curtype:=17;
curexp:=mem[p+1].int;freenode(p,2);end;end;
{:558}{559:}procedure fixdependencies;label 30;var p,q,r,s,t:halfword;
x:halfword;begin r:=mem[5].hh.rh;s:=0;while r<>5 do begin t:=r;
{560:}r:=t+1;while true do begin q:=mem[r].hh.rh;x:=mem[q].hh.lh;
if x=0 then goto 30;
if mem[x].hh.b0<=1 then begin if mem[x].hh.b0<1 then begin p:=getavail;
mem[p].hh.rh:=s;s:=p;mem[s].hh.lh:=x;mem[x].hh.b0:=1;end;
mem[q+1].int:=mem[q+1].int div 4;
if mem[q+1].int=0 then begin mem[r].hh.rh:=mem[q].hh.rh;freenode(q,2);
q:=r;end;end;r:=q;end;30:{:560};r:=mem[q].hh.rh;
if q=mem[t+1].hh.rh then makeknown(t,q);end;
while s<>0 do begin p:=mem[s].hh.rh;x:=mem[s].hh.lh;
begin mem[s].hh.rh:=avail;avail:=s;{dynused:=dynused-1;}end;s:=p;
mem[x].hh.b0:=20;mem[x+1].int:=mem[x+1].int+2;end;fixneeded:=false;end;
{:559}{289:}procedure tossknotlist(p:halfword);var q:halfword;
r:halfword;begin q:=p;repeat r:=mem[q].hh.rh;freenode(q,8);q:=r;
until q=p;end;{:289}{407:}{408:}procedure flushdashlist(h:halfword);
var p,q:halfword;begin q:=mem[h].hh.rh;while q<>2 do begin p:=q;
q:=mem[q].hh.rh;freenode(p,3);end;mem[h].hh.rh:=2;end;
{:408}{409:}function tossgrobject(p:halfword):halfword;var e:halfword;
begin e:=0;
{410:}case mem[p].hh.b0 of 1:begin tossknotlist(mem[p+1].hh.rh);
if mem[p+1].hh.lh<>0 then tossknotlist(mem[p+1].hh.lh);
if mem[p+8].hh.lh<>0 then begin if strref[mem[p+8].hh.lh]<127 then if
strref[mem[p+8].hh.lh]>1 then strref[mem[p+8].hh.lh]:=strref[mem[p+8].hh
.lh]-1 else flushstring(mem[p+8].hh.lh);end;
if mem[p+8].hh.rh<>0 then begin if strref[mem[p+8].hh.rh]<127 then if
strref[mem[p+8].hh.rh]>1 then strref[mem[p+8].hh.rh]:=strref[mem[p+8].hh
.rh]-1 else flushstring(mem[p+8].hh.rh);end;end;
2:begin tossknotlist(mem[p+1].hh.rh);
if mem[p+1].hh.lh<>0 then tossknotlist(mem[p+1].hh.lh);
if mem[p+8].hh.lh<>0 then begin if strref[mem[p+8].hh.lh]<127 then if
strref[mem[p+8].hh.lh]>1 then strref[mem[p+8].hh.lh]:=strref[mem[p+8].hh
.lh]-1 else flushstring(mem[p+8].hh.lh);end;
if mem[p+8].hh.rh<>0 then begin if strref[mem[p+8].hh.rh]<127 then if
strref[mem[p+8].hh.rh]>1 then strref[mem[p+8].hh.rh]:=strref[mem[p+8].hh
.rh]-1 else flushstring(mem[p+8].hh.rh);end;e:=mem[p+9].hh.rh;end;
3:begin begin if strref[mem[p+1].hh.rh]<127 then if strref[mem[p+1].hh.
rh]>1 then strref[mem[p+1].hh.rh]:=strref[mem[p+1].hh.rh]-1 else
flushstring(mem[p+1].hh.rh);end;
if mem[p+8].hh.lh<>0 then begin if strref[mem[p+8].hh.lh]<127 then if
strref[mem[p+8].hh.lh]>1 then strref[mem[p+8].hh.lh]:=strref[mem[p+8].hh
.lh]-1 else flushstring(mem[p+8].hh.lh);end;
if mem[p+8].hh.rh<>0 then begin if strref[mem[p+8].hh.rh]<127 then if
strref[mem[p+8].hh.rh]>1 then strref[mem[p+8].hh.rh]:=strref[mem[p+8].hh
.rh]-1 else flushstring(mem[p+8].hh.rh);end;end;
4,5:tossknotlist(mem[p+1].hh.rh);6,7:;end;{:410};
freenode(p,grobjectsize[mem[p].hh.b0]);tossgrobject:=e;end;
{:409}procedure tossedges(h:halfword);var p,q:halfword;r:halfword;
begin flushdashlist(h);q:=mem[h+7].hh.rh;while(q<>0)do begin p:=q;
q:=mem[q].hh.rh;r:=tossgrobject(p);
if r<>0 then if mem[r].hh.lh=0 then tossedges(r)else mem[r].hh.lh:=mem[r
].hh.lh-1;end;freenode(h,8);end;
{:407}{575:}procedure ringdelete(p:halfword);var q:halfword;
begin q:=mem[p+1].int;
if q<>0 then if q<>p then begin while mem[q+1].int<>p do q:=mem[q+1].int
;mem[q+1].int:=mem[p+1].int;end;end;
{:575}{798:}procedure recyclevalue(p:halfword);label 30;
var t:smallnumber;v:integer;vv:integer;q,r,s,pp:halfword;
begin t:=mem[p].hh.b0;if t<18 then v:=mem[p+1].int;
case t of 0,1,2,17,16:;3,5,7,11,9:ringdelete(p);
4:begin if strref[v]<127 then if strref[v]>1 then strref[v]:=strref[v]-1
else flushstring(v);end;8,6:tossknotlist(v);
10:if mem[v].hh.lh=0 then tossedges(v)else mem[v].hh.lh:=mem[v].hh.lh-1;
14,15,13,12:{799:}if v<>0 then begin q:=v+bignodesize[t];repeat q:=q-2;
recyclevalue(q);until q=v;freenode(v,bignodesize[t]);end{:799};
18,19:{800:}begin q:=mem[p+1].hh.rh;
while mem[q].hh.lh<>0 do q:=mem[q].hh.rh;
mem[mem[p+1].hh.lh].hh.rh:=mem[q].hh.rh;
mem[mem[q].hh.rh+1].hh.lh:=mem[p+1].hh.lh;mem[q].hh.rh:=0;
flushnodelist(mem[p+1].hh.rh);end{:800};20:{801:}begin maxc[18]:=0;
maxc[19]:=0;maxlink[18]:=0;maxlink[19]:=0;q:=mem[5].hh.rh;
while q<>5 do begin s:=q+1;while true do begin r:=mem[s].hh.rh;
if mem[r].hh.lh=0 then goto 30;
if mem[r].hh.lh<>p then s:=r else begin t:=mem[q].hh.b0;
mem[s].hh.rh:=mem[r].hh.rh;mem[r].hh.lh:=q;
if abs(mem[r+1].int)>maxc[t]then{803:}begin if maxc[t]>0 then begin mem[
maxptr[t]].hh.rh:=maxlink[t];maxlink[t]:=maxptr[t];end;
maxc[t]:=abs(mem[r+1].int);maxptr[t]:=r;
end{:803}else begin mem[r].hh.rh:=maxlink[t];maxlink[t]:=r;end;end;end;
30:q:=mem[r].hh.rh;end;
if(maxc[18]>0)or(maxc[19]>0)then{804:}begin if(maxc[18]div 4096>=maxc[19
])then t:=18 else t:=19;{805:}s:=maxptr[t];pp:=mem[s].hh.lh;
v:=mem[s+1].int;
if t=18 then mem[s+1].int:=-268435456 else mem[s+1].int:=-65536;
r:=mem[pp+1].hh.rh;mem[s].hh.rh:=r;
while mem[r].hh.lh<>0 do r:=mem[r].hh.rh;q:=mem[r].hh.rh;
mem[r].hh.rh:=0;mem[q+1].hh.lh:=mem[pp+1].hh.lh;
mem[mem[pp+1].hh.lh].hh.rh:=q;
begin if serialno=2147483584 then overflow(623,33554431);
mem[pp].hh.b0:=20;serialno:=serialno+64;mem[pp+1].int:=serialno;end;
if curexp=pp then if curtype=t then curtype:=20;
if internal[2]>0 then{806:}if interesting(p)then begin begindiagnostic;
printnl(843);if v>0 then printchar(45);
if t=18 then vv:=roundfraction(maxc[18])else vv:=maxc[19];
if vv<>65536 then printscaled(vv);printvariablename(p);
while mem[p+1].int mod 64>0 do begin print(625);
mem[p+1].int:=mem[p+1].int-2;end;
if t=18 then printchar(61)else print(844);printdependency(s,t);
enddiagnostic(false);end{:806}{:805};t:=37-t;
if maxc[t]>0 then begin mem[maxptr[t]].hh.rh:=maxlink[t];
maxlink[t]:=maxptr[t];end;
if t<>18 then{807:}for t:=18 to 19 do begin r:=maxlink[t];
while r<>0 do begin q:=mem[r].hh.lh;
mem[q+1].hh.rh:=pplusfq(mem[q+1].hh.rh,makefraction(mem[r+1].int,-v),s,t
,18);if mem[q+1].hh.rh=depfinal then makeknown(q,depfinal);q:=r;
r:=mem[r].hh.rh;freenode(q,2);end;
end{:807}else{808:}for t:=18 to 19 do begin r:=maxlink[t];
while r<>0 do begin q:=mem[r].hh.lh;
if t=18 then begin if curexp=q then if curtype=18 then curtype:=19;
mem[q+1].hh.rh:=poverv(mem[q+1].hh.rh,65536,18,19);mem[q].hh.b0:=19;
mem[r+1].int:=roundfraction(mem[r+1].int);end;
mem[q+1].hh.rh:=pplusfq(mem[q+1].hh.rh,makescaled(mem[r+1].int,-v),s,19,
19);if mem[q+1].hh.rh=depfinal then makeknown(q,depfinal);q:=r;
r:=mem[r].hh.rh;freenode(q,2);end;end{:808};flushnodelist(s);
if fixneeded then fixdependencies;begin if aritherror then cleararith;
end;end{:804};end{:801};21,22:confusion(842);
23,24:deletemacref(mem[p+1].int);end;mem[p].hh.b0:=0;end;
{:798}{797:}procedure flushcurexp(v:scaled);
begin case curtype of 3,5,7,11,9,12,13,15,18,19,20,14:begin recyclevalue
(curexp);freenode(curexp,2);end;
4:begin if strref[curexp]<127 then if strref[curexp]>1 then strref[
curexp]:=strref[curexp]-1 else flushstring(curexp);end;
6,8:tossknotlist(curexp);
10:if mem[curexp].hh.lh=0 then tossedges(curexp)else mem[curexp].hh.lh:=
mem[curexp].hh.lh-1;others:end;curtype:=17;curexp:=v;end;
{:797}{809:}procedure flusherror(v:scaled);begin error;flushcurexp(v);
end;procedure backerror;forward;procedure getxnext;forward;
procedure putgeterror;begin backerror;getxnext;end;
procedure putgetflusherror(v:scaled);begin putgeterror;flushcurexp(v);
end;{:809}{266:}procedure flushbelowvariable(p:halfword);
var q,r:halfword;
begin if mem[p].hh.b0<>22 then recyclevalue(p)else begin q:=mem[p+1].hh.
rh;while mem[q].hh.b1=3 do begin flushbelowvariable(q);r:=q;
q:=mem[q].hh.rh;freenode(r,3);end;r:=mem[p+1].hh.lh;q:=mem[r].hh.rh;
recyclevalue(r);if mem[p].hh.b1<=1 then freenode(r,2)else freenode(r,3);
repeat flushbelowvariable(q);r:=q;q:=mem[q].hh.rh;freenode(r,3);
until q=9;mem[p].hh.b0:=0;end;end;
{:266}procedure flushvariable(p,t:halfword;discardsuffixes:boolean);
label 10;var q,r:halfword;n:halfword;
begin while t<>0 do begin if mem[p].hh.b0<>22 then goto 10;
n:=mem[t].hh.lh;t:=mem[t].hh.rh;if n=0 then begin r:=p+1;
q:=mem[r].hh.rh;
while mem[q].hh.b1=3 do begin flushvariable(q,t,discardsuffixes);
if t=0 then if mem[q].hh.b0=22 then r:=q else begin mem[r].hh.rh:=mem[q]
.hh.rh;freenode(q,3);end else r:=q;q:=mem[r].hh.rh;end;end;
p:=mem[p+1].hh.lh;repeat r:=p;p:=mem[p].hh.rh;until mem[p+2].hh.lh>=n;
if mem[p+2].hh.lh<>n then goto 10;end;
if discardsuffixes then flushbelowvariable(p)else begin if mem[p].hh.b0=
22 then p:=mem[p+1].hh.lh;recyclevalue(p);end;10:end;
{:265}{267:}function undtype(p:halfword):smallnumber;
begin case mem[p].hh.b0 of 0,1:undtype:=0;2,3:undtype:=3;4,5:undtype:=5;
6,7:undtype:=7;8,9:undtype:=9;10,11:undtype:=11;
12,13,14,15,16:undtype:=mem[p].hh.b0;17,18,19,20:undtype:=16;end;end;
{:267}{268:}procedure clearsymbol(p:halfword;saving:boolean);
var q:halfword;begin q:=eqtb[p].rh;
case eqtb[p].lh mod 85 of 13,55,46,51:if not saving then deletemacref(q)
;43:if q<>0 then if saving then mem[q].hh.b1:=1 else begin
flushbelowvariable(q);freenode(q,2);end;others:end;eqtb[p]:=eqtb[2371];
end;{:268}{271:}procedure savevariable(q:halfword);var p:halfword;
begin if saveptr<>0 then begin p:=getnode(2);mem[p].hh.lh:=q;
mem[p].hh.rh:=saveptr;mem[p+1].hh:=eqtb[q];saveptr:=p;end;
clearsymbol(q,(saveptr<>0));end;
{:271}{272:}procedure saveinternal(q:halfword);var p:halfword;
begin if saveptr<>0 then begin p:=getnode(2);mem[p].hh.lh:=2371+q;
mem[p].hh.rh:=saveptr;mem[p+1].int:=internal[q];saveptr:=p;end;end;
{:272}{273:}procedure unsave;var q:halfword;p:halfword;
begin while mem[saveptr].hh.lh<>0 do begin q:=mem[saveptr].hh.lh;
if q>2371 then begin if internal[7]>0 then begin begindiagnostic;
printnl(552);print(intname[q-(2371)]);printchar(61);
printscaled(mem[saveptr+1].int);printchar(125);enddiagnostic(false);end;
internal[q-(2371)]:=mem[saveptr+1].int;
end else begin if internal[7]>0 then begin begindiagnostic;printnl(552);
print(hash[q].rh);printchar(125);enddiagnostic(false);end;
clearsymbol(q,false);eqtb[q]:=mem[saveptr+1].hh;
if eqtb[q].lh mod 85=43 then begin p:=eqtb[q].rh;
if p<>0 then mem[p].hh.b1:=0;end;end;p:=mem[saveptr].hh.rh;
freenode(saveptr,2);saveptr:=p;end;p:=mem[saveptr].hh.rh;
begin mem[saveptr].hh.rh:=avail;avail:=saveptr;{dynused:=dynused-1;}end;
saveptr:=p;end;{:273}{285:}function copyknot(p:halfword):halfword;
var q:halfword;k:0..7;begin q:=getnode(8);
for k:=0 to 7 do mem[q+k]:=mem[p+k];mem[q+7].hh.b0:=mem[p+7].hh.b0;
copyknot:=q;end;{:285}{286:}function copypath(p:halfword):halfword;
var q,pp,qq:halfword;begin q:=copyknot(p);qq:=q;pp:=mem[p].hh.rh;
while pp<>p do begin mem[qq].hh.rh:=copyknot(pp);qq:=mem[qq].hh.rh;
pp:=mem[pp].hh.rh;end;mem[qq].hh.rh:=q;copypath:=q;end;
{:286}{287:}function htapypoc(p:halfword):halfword;label 10;
var q,pp,qq,rr:halfword;begin q:=getnode(8);qq:=q;pp:=p;
while true do begin mem[qq].hh.b1:=mem[pp].hh.b0;
mem[qq].hh.b0:=mem[pp].hh.b1;mem[qq+1].int:=mem[pp+1].int;
mem[qq+2].int:=mem[pp+2].int;mem[qq+5].int:=mem[pp+3].int;
mem[qq+6].int:=mem[pp+4].int;mem[qq+3].int:=mem[pp+5].int;
mem[qq+4].int:=mem[pp+6].int;mem[qq+7].hh.b0:=mem[pp+7].hh.b0;
if mem[pp].hh.rh=p then begin mem[q].hh.rh:=qq;pathtail:=pp;htapypoc:=q;
goto 10;end;rr:=getnode(8);mem[rr].hh.rh:=qq;qq:=rr;pp:=mem[pp].hh.rh;
end;10:end;
{:287}{290:}{306:}{318:}function curlratio(gamma,atension,btension:
scaled):fraction;var alpha,beta,num,denom,ff:fraction;
begin alpha:=makefraction(65536,atension);
beta:=makefraction(65536,btension);
if alpha<=beta then begin ff:=makefraction(alpha,beta);
ff:=takefraction(ff,ff);gamma:=takefraction(gamma,ff);
beta:=beta div 4096;denom:=takefraction(gamma,alpha)+196608-beta;
num:=takefraction(gamma,805306368-alpha)+beta;
end else begin ff:=makefraction(beta,alpha);ff:=takefraction(ff,ff);
beta:=takefraction(beta,ff)div 4096;
denom:=takefraction(gamma,alpha)+(ff div 1365)-beta;
num:=takefraction(gamma,805306368-alpha)+beta;end;
if num>=denom+denom+denom+denom then curlratio:=1073741824 else
curlratio:=makefraction(num,denom);end;
{:318}{321:}procedure setcontrols(p,q:halfword;k:integer);
var rr,ss:fraction;lt,rt:scaled;sine:fraction;
begin lt:=abs(mem[q+4].int);rt:=abs(mem[p+6].int);
rr:=velocity(st,ct,sf,cf,rt);ss:=velocity(sf,cf,st,ct,lt);
if(mem[p+6].int<0)or(mem[q+4].int<0)then{322:}if((st>=0)and(sf>=0))or((
st<=0)and(sf<=0))then begin sine:=takefraction(abs(st),cf)+takefraction(
abs(sf),ct);if sine>0 then begin sine:=takefraction(sine,268500992);
if mem[p+6].int<0 then if abvscd(abs(sf),268435456,rr,sine)<0 then rr:=
makefraction(abs(sf),sine);
if mem[q+4].int<0 then if abvscd(abs(st),268435456,ss,sine)<0 then ss:=
makefraction(abs(st),sine);end;end{:322};
mem[p+5].int:=mem[p+1].int+takefraction(takefraction(deltax[k],ct)-
takefraction(deltay[k],st),rr);
mem[p+6].int:=mem[p+2].int+takefraction(takefraction(deltay[k],ct)+
takefraction(deltax[k],st),rr);
mem[q+3].int:=mem[q+1].int-takefraction(takefraction(deltax[k],cf)+
takefraction(deltay[k],sf),ss);
mem[q+4].int:=mem[q+2].int-takefraction(takefraction(deltay[k],cf)-
takefraction(deltax[k],sf),ss);mem[p].hh.b1:=1;mem[q].hh.b0:=1;end;
{:321}procedure solvechoices(p,q:halfword;n:halfword);label 40,10;
var k:0..pathsize;r,s,t:halfword;{308:}aa,bb,cc,ff,acc:fraction;
dd,ee:scaled;lt,rt:scaled;{:308}begin k:=0;s:=p;
while true do begin t:=mem[s].hh.rh;
if k=0 then{307:}case mem[s].hh.b1 of 2:if mem[t].hh.b0=2 then{323:}
begin aa:=narg(deltax[0],deltay[0]);nsincos(mem[p+5].int-aa);ct:=ncos;
st:=nsin;nsincos(mem[q+3].int-aa);cf:=ncos;sf:=-nsin;setcontrols(p,q,0);
goto 10;
end{:323}else{315:}begin vv[0]:=mem[s+5].int-narg(deltax[0],deltay[0]);
if abs(vv[0])>188743680 then if vv[0]>0 then vv[0]:=vv[0]-377487360 else
vv[0]:=vv[0]+377487360;uu[0]:=0;ww[0]:=0;end{:315};
3:if mem[t].hh.b0=3 then{324:}begin mem[p].hh.b1:=1;mem[q].hh.b0:=1;
lt:=abs(mem[q+4].int);rt:=abs(mem[p+6].int);
if rt=65536 then begin if deltax[0]>=0 then mem[p+5].int:=mem[p+1].int+(
(deltax[0]+1)div 3)else mem[p+5].int:=mem[p+1].int+((deltax[0]-1)div 3);
if deltay[0]>=0 then mem[p+6].int:=mem[p+2].int+((deltay[0]+1)div 3)else
mem[p+6].int:=mem[p+2].int+((deltay[0]-1)div 3);
end else begin ff:=makefraction(65536,3*rt);
mem[p+5].int:=mem[p+1].int+takefraction(deltax[0],ff);
mem[p+6].int:=mem[p+2].int+takefraction(deltay[0],ff);end;
if lt=65536 then begin if deltax[0]>=0 then mem[q+3].int:=mem[q+1].int-(
(deltax[0]+1)div 3)else mem[q+3].int:=mem[q+1].int-((deltax[0]-1)div 3);
if deltay[0]>=0 then mem[q+4].int:=mem[q+2].int-((deltay[0]+1)div 3)else
mem[q+4].int:=mem[q+2].int-((deltay[0]-1)div 3);
end else begin ff:=makefraction(65536,3*lt);
mem[q+3].int:=mem[q+1].int-takefraction(deltax[0],ff);
mem[q+4].int:=mem[q+2].int-takefraction(deltay[0],ff);end;goto 10;
end{:324}else{316:}begin cc:=mem[s+5].int;lt:=abs(mem[t+4].int);
rt:=abs(mem[s+6].int);
if(rt=65536)and(lt=65536)then uu[0]:=makefraction(cc+cc+65536,cc+131072)
else uu[0]:=curlratio(cc,rt,lt);vv[0]:=-takefraction(psi[1],uu[0]);
ww[0]:=0;end{:316};4:begin uu[0]:=0;vv[0]:=0;ww[0]:=268435456;end;
end{:307}else case mem[s].hh.b0 of 5,4:{309:}begin{310:}if abs(mem[r+6].
int)=65536 then begin aa:=134217728;dd:=2*delta[k];
end else begin aa:=makefraction(65536,3*abs(mem[r+6].int)-65536);
dd:=takefraction(delta[k],805306368-makefraction(65536,abs(mem[r+6].int)
));end;if abs(mem[t+4].int)=65536 then begin bb:=134217728;
ee:=2*delta[k-1];
end else begin bb:=makefraction(65536,3*abs(mem[t+4].int)-65536);
ee:=takefraction(delta[k-1],805306368-makefraction(65536,abs(mem[t+4].
int)));end;cc:=268435456-takefraction(uu[k-1],aa){:310};
{311:}dd:=takefraction(dd,cc);lt:=abs(mem[s+4].int);
rt:=abs(mem[s+6].int);
if lt<>rt then if lt<rt then begin ff:=makefraction(lt,rt);
ff:=takefraction(ff,ff);dd:=takefraction(dd,ff);
end else begin ff:=makefraction(rt,lt);ff:=takefraction(ff,ff);
ee:=takefraction(ee,ff);end;ff:=makefraction(ee,ee+dd){:311};
uu[k]:=takefraction(ff,bb);{312:}acc:=-takefraction(psi[k+1],uu[k]);
if mem[r].hh.b1=3 then begin ww[k]:=0;
vv[k]:=acc-takefraction(psi[1],268435456-ff);
end else begin ff:=makefraction(268435456-ff,cc);
acc:=acc-takefraction(psi[k],ff);ff:=takefraction(ff,aa);
vv[k]:=acc-takefraction(vv[k-1],ff);
if ww[k-1]=0 then ww[k]:=0 else ww[k]:=-takefraction(ww[k-1],ff);
end{:312};if mem[s].hh.b0=5 then{313:}begin aa:=0;bb:=268435456;
repeat k:=k-1;if k=0 then k:=n;aa:=vv[k]-takefraction(aa,uu[k]);
bb:=ww[k]-takefraction(bb,uu[k]);until k=n;
aa:=makefraction(aa,268435456-bb);theta[n]:=aa;vv[0]:=aa;
for k:=1 to n-1 do vv[k]:=vv[k]+takefraction(aa,ww[k]);goto 40;
end{:313};end{:309};3:{317:}begin cc:=mem[s+3].int;
lt:=abs(mem[s+4].int);rt:=abs(mem[r+6].int);
if(rt=65536)and(lt=65536)then ff:=makefraction(cc+cc+65536,cc+131072)
else ff:=curlratio(cc,lt,rt);
theta[n]:=-makefraction(takefraction(vv[n-1],ff),268435456-takefraction(
ff,uu[n-1]));goto 40;end{:317};
2:{314:}begin theta[n]:=mem[s+3].int-narg(deltax[n-1],deltay[n-1]);
if abs(theta[n])>188743680 then if theta[n]>0 then theta[n]:=theta[n]
-377487360 else theta[n]:=theta[n]+377487360;goto 40;end{:314};end;r:=s;
s:=t;k:=k+1;end;
40:{319:}for k:=n-1 downto 0 do theta[k]:=vv[k]-takefraction(theta[k+1],
uu[k]);s:=p;k:=0;repeat t:=mem[s].hh.rh;nsincos(theta[k]);st:=nsin;
ct:=ncos;nsincos(-psi[k+1]-theta[k+1]);sf:=nsin;cf:=ncos;
setcontrols(s,t,k);k:=k+1;s:=t;until k=n{:319};10:end;
{:306}procedure makechoices(knots:halfword);label 30;var h:halfword;
p,q:halfword;{302:}k,n:0..pathsize;s,t:halfword;delx,dely:scaled;
sine,cosine:fraction;{:302}begin begin if aritherror then cleararith;
end;if internal[4]>0 then printpath(knots,562,true);{292:}p:=knots;
repeat q:=mem[p].hh.rh;
if mem[p+1].int=mem[q+1].int then if mem[p+2].int=mem[q+2].int then if
mem[p].hh.b1>1 then begin mem[p].hh.b1:=1;
if mem[p].hh.b0=4 then begin mem[p].hh.b0:=3;mem[p+3].int:=65536;end;
mem[q].hh.b0:=1;if mem[q].hh.b1=4 then begin mem[q].hh.b1:=3;
mem[q+5].int:=65536;end;mem[p+5].int:=mem[p+1].int;
mem[q+3].int:=mem[p+1].int;mem[p+6].int:=mem[p+2].int;
mem[q+4].int:=mem[p+2].int;end;p:=q;until p=knots{:292};{293:}h:=knots;
while true do begin if mem[h].hh.b0<>4 then goto 30;
if mem[h].hh.b1<>4 then goto 30;h:=mem[h].hh.rh;
if h=knots then begin mem[h].hh.b0:=5;goto 30;end;end;30:{:293};p:=h;
repeat{294:}q:=mem[p].hh.rh;
if mem[p].hh.b1>=2 then begin while(mem[q].hh.b0=4)and(mem[q].hh.b1=4)do
q:=mem[q].hh.rh;{300:}{303:}k:=0;s:=p;n:=pathsize;
repeat t:=mem[s].hh.rh;deltax[k]:=mem[t+1].int-mem[s+1].int;
deltay[k]:=mem[t+2].int-mem[s+2].int;
delta[k]:=pythadd(deltax[k],deltay[k]);
if k>0 then begin sine:=makefraction(deltay[k-1],delta[k-1]);
cosine:=makefraction(deltax[k-1],delta[k-1]);
psi[k]:=narg(takefraction(deltax[k],cosine)+takefraction(deltay[k],sine)
,takefraction(deltay[k],cosine)-takefraction(deltax[k],sine));end;
k:=k+1;s:=t;if k=pathsize then overflow(567,pathsize);if s=q then n:=k;
until(k>=n)and(mem[s].hh.b0<>5);
if k=n then psi[n]:=0 else psi[k]:=psi[1]{:303};
{304:}if mem[q].hh.b0=4 then begin delx:=mem[q+5].int-mem[q+1].int;
dely:=mem[q+6].int-mem[q+2].int;
if(delx=0)and(dely=0)then begin mem[q].hh.b0:=3;mem[q+3].int:=65536;
end else begin mem[q].hh.b0:=2;mem[q+3].int:=narg(delx,dely);end;end;
if(mem[p].hh.b1=4)and(mem[p].hh.b0=1)then begin delx:=mem[p+1].int-mem[p
+3].int;dely:=mem[p+2].int-mem[p+4].int;
if(delx=0)and(dely=0)then begin mem[p].hh.b1:=3;mem[p+5].int:=65536;
end else begin mem[p].hh.b1:=2;mem[p+5].int:=narg(delx,dely);end;
end{:304};solvechoices(p,q,n){:300};
end else if mem[p].hh.b1=0 then{295:}begin mem[p+5].int:=mem[p+1].int;
mem[p+6].int:=mem[p+2].int;mem[q+3].int:=mem[q+1].int;
mem[q+4].int:=mem[q+2].int;end{:295};p:=q{:294};until p=h;
if internal[4]>0 then printpath(knots,563,true);
if aritherror then{291:}begin begin if interaction=3 then;printnl(263);
print(564);end;begin helpptr:=2;helpline[1]:=565;helpline[0]:=566;end;
putgeterror;aritherror:=false;end{:291};end;
{:290}{327:}function crossingpoint(a,b,c:integer):fraction;label 10;
var d:integer;x,xx,x0,x1,x2:integer;
begin if a<0 then begin crossingpoint:=0;goto 10;end;
if c>=0 then begin if b>=0 then if c>0 then begin crossingpoint:=
268435457;goto 10;
end else if(a=0)and(b=0)then begin crossingpoint:=268435457;goto 10;
end else begin crossingpoint:=268435456;goto 10;end;
if a=0 then begin crossingpoint:=0;goto 10;end;
end else if a=0 then if b<=0 then begin crossingpoint:=0;goto 10;end;
{328:}d:=1;x0:=a;x1:=a-b;x2:=b-c;repeat x:=(x1+x2)div 2;
if x1-x0>x0 then begin x2:=x;x0:=x0+x0;d:=d+d;
end else begin xx:=x1+x-x0;if xx>x0 then begin x2:=x;x0:=x0+x0;d:=d+d;
end else begin x0:=x0-xx;
if x<=x0 then if x+x2<=x0 then begin crossingpoint:=268435457;goto 10;
end;x1:=x;d:=d+d+1;end;end;until d>=268435456;
crossingpoint:=d-268435456{:328};10:end;
{:327}{329:}function evalcubic(p,q:halfword;t:fraction):scaled;
var x1,x2,x3:scaled;
begin x1:=mem[p].int-takefraction(mem[p].int-mem[p+4].int,t);
x2:=mem[p+4].int-takefraction(mem[p+4].int-mem[q+2].int,t);
x3:=mem[q+2].int-takefraction(mem[q+2].int-mem[q].int,t);
x1:=x1-takefraction(x1-x2,t);x2:=x2-takefraction(x2-x3,t);
evalcubic:=x1-takefraction(x1-x2,t);end;
{:329}{331:}procedure boundcubic(p,q:halfword;c:smallnumber);
var wavy:boolean;del1,del2,del3,del,dmax:scaled;t,tt:fraction;x:scaled;
begin x:=mem[q].int;{332:}if x<bbmin[c]then bbmin[c]:=x;
if x>bbmax[c]then bbmax[c]:=x{:332};{333:}wavy:=true;
if bbmin[c]<=mem[p+4].int then if mem[p+4].int<=bbmax[c]then if bbmin[c]
<=mem[q+2].int then if mem[q+2].int<=bbmax[c]then wavy:=false{:333};
if wavy then begin del1:=mem[p+4].int-mem[p].int;
del2:=mem[q+2].int-mem[p+4].int;del3:=mem[q].int-mem[q+2].int;
{334:}if del1<>0 then del:=del1 else if del2<>0 then del:=del2 else del
:=del3;if del<>0 then begin dmax:=abs(del1);
if abs(del2)>dmax then dmax:=abs(del2);
if abs(del3)>dmax then dmax:=abs(del3);
while dmax<134217728 do begin dmax:=dmax+dmax;del1:=del1+del1;
del2:=del2+del2;del3:=del3+del3;end;end{:334};
if del<0 then begin del1:=-del1;del2:=-del2;del3:=-del3;end;
t:=crossingpoint(del1,del2,del3);
if t<268435456 then{335:}begin x:=evalcubic(p,q,t);
{332:}if x<bbmin[c]then bbmin[c]:=x;if x>bbmax[c]then bbmax[c]:=x{:332};
del2:=del2-takefraction(del2-del3,t);if del2>0 then del2:=0;
tt:=crossingpoint(0,-del2,-del3);
if tt<268435456 then{336:}begin x:=evalcubic(p,q,tt-takefraction(tt
-268435456,t));{332:}if x<bbmin[c]then bbmin[c]:=x;
if x>bbmax[c]then bbmax[c]:=x{:332};end{:336};end{:335};end;end;
{:331}{337:}procedure pathbbox(h:halfword);label 10;var p,q:halfword;
begin bbmin[0]:=mem[h+1].int;bbmin[1]:=mem[h+2].int;bbmax[0]:=bbmin[0];
bbmax[1]:=bbmin[1];p:=h;repeat if mem[p].hh.b1=0 then goto 10;
q:=mem[p].hh.rh;boundcubic(p+1,q+1,0);boundcubic(p+2,q+2,1);p:=q;
until p=h;10:end;
{:337}{340:}{350:}function solverisingcubic(a,b,c,x:scaled):scaled;
var ab,bc,ac:scaled;t:integer;xx:integer;
begin if(a<0)or(c<0)then confusion(568);
if x<=0 then solverisingcubic:=0 else if x>=a+b+c then solverisingcubic
:=65536 else begin t:=1;
{352:}while(a>715827882)or(b>715827882)or(c>715827882)do begin a:=(a)div
2;b:=(b)div 2;c:=(c)div 2;x:=(x)div 2;end{:352};repeat t:=t+t;
{351:}ab:=(a+b)div 2;bc:=(b+c)div 2;ac:=(ab+bc)div 2{:351};
xx:=x-a-ab-ac;if xx<-x then begin x:=x+x;b:=ab;c:=ac;
end else begin x:=x+xx;a:=ac;b:=bc;t:=t+1;end;until t>=65536;
solverisingcubic:=t-65536;end;end;
{:350}function arctest(dx0,dy0,dx1,dy1,dx2,dy2,v0,v02,v2,agoal,tol:
scaled):scaled;label 10;var simple:boolean;
dx01,dy01,dx12,dy12,dx02,dy02:scaled;v002,v022:scaled;arc:scaled;
{342:}a,b:scaled;anew,aaux:scaled;{:342}{347:}tmp,tmp2:scaled;
arc1:scaled;{:347}begin{345:}dx01:=(dx0+dx1)div 2;dx12:=(dx1+dx2)div 2;
dx02:=(dx01+dx12)div 2;dy01:=(dy0+dy1)div 2;dy12:=(dy1+dy2)div 2;
dy02:=(dy01+dy12)div 2{:345};
{346:}v002:=pythadd(dx01+(dx0+dx02)div 2,dy01+(dy0+dy02)div 2);
v022:=pythadd(dx12+(dx02+dx2)div 2,dy12+(dy02+dy2)div 2);
tmp:=(v02+2)div 2;arc1:=v002+((v0+tmp)div 2-v002)div 2;
arc:=v022+((v2+tmp)div 2-v022)div 2;
if(arc<2147483647-arc1)then arc:=arc+arc1 else begin aritherror:=true;
if agoal=2147483647 then arctest:=2147483647 else arctest:=-131072;
goto 10;end{:346};
{348:}simple:=(dx0>=0)and(dx1>=0)and(dx2>=0)or(dx0<=0)and(dx1<=0)and(dx2
<=0);
if simple then simple:=(dy0>=0)and(dy1>=0)and(dy2>=0)or(dy0<=0)and(dy1<=
0)and(dy2<=0);
if not simple then begin simple:=(dx0>=dy0)and(dx1>=dy1)and(dx2>=dy2)or(
dx0<=dy0)and(dx1<=dy1)and(dx2<=dy2);
if simple then simple:=(-dx0>=dy0)and(-dx1>=dy1)and(-dx2>=dy2)or(-dx0<=
dy0)and(-dx1<=dy1)and(-dx2<=dy2);end{:348};
if simple and(abs(arc-v02-(v0+v2)div 2)<=tol)then if arc<agoal then
arctest:=arc else{349:}begin tmp:=(v02+2)div 4;
if agoal<=arc1 then begin tmp2:=(v0)div 2;
arctest:=(solverisingcubic(tmp2,arc1-tmp2-tmp,tmp,agoal))div 2-131072;
end else begin tmp2:=(v2)div 2;
arctest:=(-98304)+(solverisingcubic(tmp,arc-arc1-tmp-tmp2,tmp2,agoal-
arc1))div 2;end;end{:349}else{341:}begin{343:}aaux:=2147483647-agoal;
if agoal>aaux then begin aaux:=agoal-aaux;anew:=2147483647;
end else begin anew:=agoal+agoal;aaux:=0;end{:343};tol:=tol+(tol)div 2;
a:=arctest(dx0,dy0,dx01,dy01,dx02,dy02,v0,v002,(v02)div 2,anew,tol);
if a<0 then arctest:=-(131072-a)div 2 else begin{344:}if a>aaux then
begin aaux:=aaux-a;anew:=anew+aaux;end{:344};
b:=arctest(dx02,dy02,dx12,dy12,dx2,dy2,(v02)div 2,v022,v2,anew,tol);
if b<0 then arctest:=-(-b)div 2-32768 else arctest:=a+(b-a)div 2;end;
end{:341};10:end;
{:340}{353:}function doarctest(dx0,dy0,dx1,dy1,dx2,dy2,agoal:scaled):
scaled;var v0,v1,v2:scaled;v02:scaled;begin v0:=pythadd(dx0,dy0);
v1:=pythadd(dx1,dy1);v2:=pythadd(dx2,dy2);
if(v0>=1073741824)or(v1>=1073741824)or(v2>=1073741824)then begin
aritherror:=true;
if agoal=2147483647 then doarctest:=2147483647 else doarctest:=-131072;
end else begin v02:=pythadd(dx1+(dx0+dx2)div 2,dy1+(dy0+dy2)div 2);
doarctest:=arctest(dx0,dy0,dx1,dy1,dx2,dy2,v0,v02,v2,agoal,16);end;end;
{:353}{354:}function getarclength(h:halfword):scaled;label 30;
var p,q:halfword;a,atot:scaled;begin atot:=0;p:=h;
while mem[p].hh.b1<>0 do begin q:=mem[p].hh.rh;
a:=doarctest(mem[p+5].int-mem[p+1].int,mem[p+6].int-mem[p+2].int,mem[q+3
].int-mem[p+5].int,mem[q+4].int-mem[p+6].int,mem[q+1].int-mem[q+3].int,
mem[q+2].int-mem[q+4].int,2147483647);atot:=slowadd(a,atot);
if q=h then goto 30 else p:=q;end;
30:begin if aritherror then cleararith;end;getarclength:=atot;end;
{:354}{355:}function getarctime(h:halfword;arc0:scaled):scaled;label 30;
var p,q:halfword;ttot:scaled;t:scaled;arc:scaled;n:integer;
begin if arc0<0 then{357:}begin if mem[h].hh.b0=0 then ttot:=0 else
begin p:=htapypoc(h);ttot:=-getarctime(p,-arc0);tossknotlist(p);end;
goto 30;end{:357};if arc0=2147483647 then arc0:=arc0-1;ttot:=0;
arc:=arc0;p:=h;while(mem[p].hh.b1<>0)and(arc>0)do begin q:=mem[p].hh.rh;
t:=doarctest(mem[p+5].int-mem[p+1].int,mem[p+6].int-mem[p+2].int,mem[q+3
].int-mem[p+5].int,mem[q+4].int-mem[p+6].int,mem[q+1].int-mem[q+3].int,
mem[q+2].int-mem[q+4].int,arc);
{356:}if t<0 then begin ttot:=ttot+t+131072;arc:=0;
end else begin ttot:=ttot+65536;arc:=arc-t;end{:356};
if q=h then{358:}if arc>0 then begin n:=arc div(arc0-arc);
arc:=arc-n*(arc0-arc);
if ttot>2147483647 div(n+1)then begin aritherror:=true;ttot:=2147483647;
goto 30;end;ttot:=(n+1)*ttot;end{:358};p:=q;end;
30:begin if aritherror then cleararith;end;getarctime:=ttot;end;
{:355}{360:}{376:}{381:}procedure moveknot(p,q:halfword);
begin mem[mem[p].hh.lh].hh.rh:=mem[p].hh.rh;
mem[mem[p].hh.rh].hh.lh:=mem[p].hh.lh;mem[p].hh.lh:=q;
mem[p].hh.rh:=mem[q].hh.rh;mem[q].hh.rh:=p;mem[mem[p].hh.rh].hh.lh:=p;
end;{:381}function convexhull(h:halfword):halfword;label 31,32,33;
var l,r:halfword;p,q:halfword;s:halfword;dx,dy:scaled;
begin if(h=mem[h].hh.rh)then convexhull:=h else begin{377:}l:=h;
p:=mem[h].hh.rh;
while p<>h do begin if mem[p+1].int<=mem[l+1].int then if(mem[p+1].int<
mem[l+1].int)or(mem[p+2].int<mem[l+2].int)then l:=p;p:=mem[p].hh.rh;
end{:377};{378:}r:=h;p:=mem[h].hh.rh;
while p<>h do begin if mem[p+1].int>=mem[r+1].int then if(mem[p+1].int>
mem[r+1].int)or(mem[p+2].int>mem[r+2].int)then r:=p;p:=mem[p].hh.rh;
end{:378};if l<>r then begin s:=mem[r].hh.rh;
{379:}dx:=mem[r+1].int-mem[l+1].int;dy:=mem[r+2].int-mem[l+2].int;
p:=mem[l].hh.rh;while p<>r do begin q:=mem[p].hh.rh;
if abvscd(dx,mem[p+2].int-mem[l+2].int,dy,mem[p+1].int-mem[l+1].int)>0
then moveknot(p,r);p:=q;end{:379};{382:}p:=s;
while p<>l do begin q:=mem[p].hh.rh;
if abvscd(dx,mem[p+2].int-mem[l+2].int,dy,mem[p+1].int-mem[l+1].int)<0
then moveknot(p,l);p:=q;end{:382};{383:}p:=mem[l].hh.rh;
while p<>r do begin q:=mem[p].hh.lh;
while mem[q+1].int>mem[p+1].int do q:=mem[q].hh.lh;
while mem[q+1].int=mem[p+1].int do if mem[q+2].int>mem[p+2].int then q:=
mem[q].hh.lh else goto 31;
31:if q=mem[p].hh.lh then p:=mem[p].hh.rh else begin p:=mem[p].hh.rh;
moveknot(mem[p].hh.lh,q);end;end{:383};{384:}p:=mem[r].hh.rh;
while p<>l do begin q:=mem[p].hh.lh;
while mem[q+1].int<mem[p+1].int do q:=mem[q].hh.lh;
while mem[q+1].int=mem[p+1].int do if mem[q+2].int<mem[p+2].int then q:=
mem[q].hh.lh else goto 32;
32:if q=mem[p].hh.lh then p:=mem[p].hh.rh else begin p:=mem[p].hh.rh;
moveknot(mem[p].hh.lh,q);end;end{:384};end;
if l<>mem[l].hh.rh then{385:}begin p:=l;q:=mem[l].hh.rh;
while true do begin dx:=mem[q+1].int-mem[p+1].int;
dy:=mem[q+2].int-mem[p+2].int;p:=q;q:=mem[q].hh.rh;if p=l then goto 33;
if p<>r then if abvscd(dx,mem[q+2].int-mem[p+2].int,dy,mem[q+1].int-mem[
p+1].int)<=0 then{386:}begin s:=mem[p].hh.lh;freenode(p,8);
mem[s].hh.rh:=q;mem[q].hh.lh:=s;
if s=l then p:=s else begin p:=mem[s].hh.lh;q:=s;end;end{:386};end;33:;
end{:385};convexhull:=l;end;end;{:376}function makepen(h:halfword;
needhull:boolean):halfword;var p,q:halfword;begin q:=h;repeat p:=q;
q:=mem[q].hh.rh;mem[q].hh.lh:=p;until q=h;
if needhull then begin h:=convexhull(h);
{362:}if(h=mem[h].hh.rh)then begin mem[h+3].int:=mem[h+1].int;
mem[h+4].int:=mem[h+2].int;mem[h+5].int:=mem[h+1].int;
mem[h+6].int:=mem[h+2].int;end{:362};end;makepen:=h;end;
{:360}{361:}function getpencircle(diam:scaled):halfword;var h:halfword;
begin h:=getnode(8);mem[h].hh.rh:=h;mem[h].hh.lh:=h;mem[h+7].hh.b0:=0;
mem[h+1].int:=0;mem[h+2].int:=0;mem[h+3].int:=diam;mem[h+4].int:=0;
mem[h+5].int:=0;mem[h+6].int:=diam;getpencircle:=h;end;
{:361}{368:}procedure makepath(h:halfword);var p:halfword;k:smallnumber;
{372:}centerx,centery:scaled;widthx,widthy:scaled;
heightx,heighty:scaled;dx,dy:scaled;kk:integer;
{:372}begin if(h=mem[h].hh.rh)then{370:}begin{371:}centerx:=mem[h+1].int
;centery:=mem[h+2].int;widthx:=mem[h+3].int-centerx;
widthy:=mem[h+4].int-centery;heightx:=mem[h+5].int-centerx;
heighty:=mem[h+6].int-centery{:371};p:=h;
for k:=0 to 7 do begin{373:}kk:=(k+6)mod 8;
mem[p+1].int:=centerx+takefraction(halfcos[k],widthx)+takefraction(
halfcos[kk],heightx);
mem[p+2].int:=centery+takefraction(halfcos[k],widthy)+takefraction(
halfcos[kk],heighty);
dx:=-takefraction(dcos[kk],widthx)+takefraction(dcos[k],heightx);
dy:=-takefraction(dcos[kk],widthy)+takefraction(dcos[k],heighty);
mem[p+5].int:=mem[p+1].int+dx;mem[p+6].int:=mem[p+2].int+dy;
mem[p+3].int:=mem[p+1].int-dx;mem[p+4].int:=mem[p+2].int-dy;
mem[p].hh.b0:=1;mem[p].hh.b1:=1;mem[p+7].hh.b0:=0{:373};
if k=7 then mem[p].hh.rh:=h else mem[p].hh.rh:=getnode(8);
p:=mem[p].hh.rh;end;end{:370}else begin p:=h;repeat mem[p].hh.b0:=1;
mem[p].hh.b1:=1;{369:}mem[p+3].int:=mem[p+1].int;
mem[p+4].int:=mem[p+2].int;mem[p+5].int:=mem[p+1].int;
mem[p+6].int:=mem[p+2].int{:369};p:=mem[p].hh.rh;until p=h;end;end;
{:368}{387:}procedure findoffset(x,y:scaled;h:halfword);
var p,q:halfword;wx,wy,hx,hy:scaled;xx,yy:fraction;d:fraction;
begin if(h=mem[h].hh.rh)then{389:}if(x=0)and(y=0)then begin curx:=mem[h
+1].int;cury:=mem[h+2].int;
end else begin{390:}wx:=mem[h+3].int-mem[h+1].int;
wy:=mem[h+4].int-mem[h+2].int;hx:=mem[h+5].int-mem[h+1].int;
hy:=mem[h+6].int-mem[h+2].int{:390};
while(abs(x)<134217728)and(abs(y)<134217728)do begin x:=x+x;y:=y+y;end;
{391:}yy:=-(takefraction(x,hy)+takefraction(y,-hx));
xx:=takefraction(x,-wy)+takefraction(y,wx);d:=pythadd(xx,yy);
if d>0 then begin xx:=(makefraction(xx,d))div 2;
yy:=(makefraction(yy,d))div 2;end{:391};
curx:=mem[h+1].int+takefraction(xx,wx)+takefraction(yy,hx);
cury:=mem[h+2].int+takefraction(xx,wy)+takefraction(yy,hy);
end{:389}else begin q:=h;repeat p:=q;q:=mem[q].hh.rh;
until abvscd(mem[q+1].int-mem[p+1].int,y,mem[q+2].int-mem[p+2].int,x)>=0
;repeat p:=q;q:=mem[q].hh.rh;
until abvscd(mem[q+1].int-mem[p+1].int,y,mem[q+2].int-mem[p+2].int,x)<=0
;curx:=mem[p+1].int;cury:=mem[p+2].int;end;end;
{:387}{392:}procedure penbbox(h:halfword);var p:halfword;
begin if(h=mem[h].hh.rh)then{393:}begin findoffset(0,268435456,h);
bbmax[0]:=curx;bbmin[0]:=2*mem[h+1].int-curx;findoffset(-268435456,0,h);
bbmax[1]:=cury;bbmin[1]:=2*mem[h+2].int-cury;
end{:393}else begin bbmin[0]:=mem[h+1].int;bbmax[0]:=bbmin[0];
bbmin[1]:=mem[h+2].int;bbmax[1]:=bbmin[1];p:=mem[h].hh.rh;
while p<>h do begin if mem[p+1].int<bbmin[0]then bbmin[0]:=mem[p+1].int;
if mem[p+2].int<bbmin[1]then bbmin[1]:=mem[p+2].int;
if mem[p+1].int>bbmax[0]then bbmax[0]:=mem[p+1].int;
if mem[p+2].int>bbmax[1]then bbmax[1]:=mem[p+2].int;p:=mem[p].hh.rh;end;
end;end;{:392}{395:}function newfillnode(p:halfword):halfword;
var t:halfword;begin t:=getnode(9);mem[t].hh.b0:=1;mem[t+1].hh.rh:=p;
mem[t+1].hh.lh:=0;mem[t+3].int:=0;mem[t+4].int:=0;mem[t+5].int:=0;
mem[t+6].int:=0;mem[t+2].hh.b0:=9;mem[t+8].hh.lh:=0;mem[t+8].hh.rh:=0;
{396:}if internal[27]>65536 then mem[t].hh.b1:=2 else if internal[27]>0
then mem[t].hh.b1:=1 else mem[t].hh.b1:=0;
if internal[29]<65536 then mem[t+7].int:=65536 else mem[t+7].int:=
internal[29]{:396};newfillnode:=t;end;
{:395}{397:}function newstrokednode(p:halfword):halfword;var t:halfword;
begin t:=getnode(11);mem[t].hh.b0:=2;mem[t+1].hh.rh:=p;
mem[t+1].hh.lh:=0;mem[t+9].hh.rh:=0;mem[t+10].int:=65536;
mem[t+3].int:=0;mem[t+4].int:=0;mem[t+5].int:=0;mem[t+6].int:=0;
mem[t+2].hh.b0:=9;mem[t+8].hh.lh:=0;mem[t+8].hh.rh:=0;
{396:}if internal[27]>65536 then mem[t].hh.b1:=2 else if internal[27]>0
then mem[t].hh.b1:=1 else mem[t].hh.b1:=0;
if internal[29]<65536 then mem[t+7].int:=65536 else mem[t+7].int:=
internal[29]{:396};
if internal[28]>65536 then mem[t+9].hh.b0:=2 else if internal[28]>0 then
mem[t+9].hh.b0:=1 else mem[t+9].hh.b0:=0;newstrokednode:=t;end;
{:397}{400:}{1193:}{748:}procedure beginname;
begin begin if strref[curname]<127 then if strref[curname]>1 then strref
[curname]:=strref[curname]-1 else flushstring(curname);end;
begin if strref[curarea]<127 then if strref[curarea]>1 then strref[
curarea]:=strref[curarea]-1 else flushstring(curarea);end;
begin if strref[curext]<127 then if strref[curext]>1 then strref[curext]
:=strref[curext]-1 else flushstring(curext);end;areadelimiter:=-1;
extdelimiter:=-1;end;{:748}{749:}function morename(c:ASCIIcode):boolean;
begin if c=32 then morename:=false else begin if(c=62)or(c=58)then begin
areadelimiter:=poolptr-strstart[strptr];extdelimiter:=-1;
end else if(c=46)and(extdelimiter<0)then extdelimiter:=poolptr-strstart[
strptr];begin if poolptr+1>maxpoolptr then if poolptr+1>poolsize then
docompaction(1)else maxpoolptr:=poolptr+1;end;begin strpool[poolptr]:=c;
poolptr:=poolptr+1;end;morename:=true;end;end;
{:749}{750:}procedure endname;var a,n,e:poolpointer;
begin e:=poolptr-strstart[strptr];
if extdelimiter<0 then extdelimiter:=e;a:=areadelimiter+1;
n:=extdelimiter-a;e:=e-extdelimiter;
if a=0 then curarea:=287 else begin curarea:=makestring;
choplaststring(strstart[curarea]+a);end;
if n=0 then curname:=287 else begin curname:=makestring;
choplaststring(strstart[curname]+n);end;
if e=0 then curext:=287 else curext:=makestring;end;
{:750}{752:}procedure packfilename(n,a,e:strnumber);var k:integer;
c:ASCIIcode;j:poolpointer;begin k:=0;
for j:=strstart[a]to strstart[nextstr[a]]-1 do begin c:=strpool[j];
k:=k+1;if k<=filenamesize then nameoffile[k]:=xchr[c];end;
for j:=strstart[n]to strstart[nextstr[n]]-1 do begin c:=strpool[j];
k:=k+1;if k<=filenamesize then nameoffile[k]:=xchr[c];end;
for j:=strstart[e]to strstart[nextstr[e]]-1 do begin c:=strpool[j];
k:=k+1;if k<=filenamesize then nameoffile[k]:=xchr[c];end;
if k<=filenamesize then namelength:=k else namelength:=filenamesize;
for k:=namelength+1 to filenamesize do nameoffile[k]:=' ';end;
{:752}{760:}procedure strscanfile(s:strnumber);label 30;
var p,q:poolpointer;begin beginname;p:=strstart[s];
q:=strstart[nextstr[s]];
while p<q do begin if not morename(strpool[p])then goto 30;p:=p+1;end;
30:endname;end;{:760}function readfontinfo(fname:strnumber):fontnumber;
label 11,30;var fileopened:boolean;n:fontnumber;
lf,lh,bc,ec,nw,nh,nd:halfword;whdsize:integer;i,ii:0..fontmemsize;
jj:0..fontmemsize;z:scaled;d:fraction;handd:eightbits;begin n:=0;
{1202:}fileopened:=false;strscanfile(fname);
if curarea=287 then curarea:=811;if curext=287 then curext:=1135;
packfilename(curname,curarea,curext);
if not bopenin(tfminfile)then goto 11;fileopened:=true{:1202};
{1195:}{1196:}begin lf:=tfminfile^;if lf>127 then goto 11;
get(tfminfile);lf:=lf*256+tfminfile^;end;get(tfminfile);
begin lh:=tfminfile^;if lh>127 then goto 11;get(tfminfile);
lh:=lh*256+tfminfile^;end;get(tfminfile);begin bc:=tfminfile^;
if bc>127 then goto 11;get(tfminfile);bc:=bc*256+tfminfile^;end;
get(tfminfile);begin ec:=tfminfile^;if ec>127 then goto 11;
get(tfminfile);ec:=ec*256+tfminfile^;end;
if(bc>1+ec)or(ec>255)then goto 11;get(tfminfile);begin nw:=tfminfile^;
if nw>127 then goto 11;get(tfminfile);nw:=nw*256+tfminfile^;end;
get(tfminfile);begin nh:=tfminfile^;if nh>127 then goto 11;
get(tfminfile);nh:=nh*256+tfminfile^;end;get(tfminfile);
begin nd:=tfminfile^;if nd>127 then goto 11;get(tfminfile);
nd:=nd*256+tfminfile^;end;whdsize:=(ec+1-bc)+nw+nh+nd;
if lf<6+lh+whdsize then goto 11;
for jj:=10 downto 1 do get(tfminfile){:1196};
{1197:}if nextfmem<bc+0 then nextfmem:=bc+0;
if(lastfnum=fontmax)or(nextfmem+whdsize>=fontmemsize)then{1198:}begin
begin if interaction=3 then;printnl(263);print(1143);end;print(fname);
print(1150);begin helpptr:=3;helpline[2]:=1151;helpline[1]:=1152;
helpline[0]:=1153;end;error;goto 30;end{:1198};lastfnum:=lastfnum+1;
n:=lastfnum;fontbc[n]:=bc;fontec[n]:=ec;charbase[n]:=nextfmem-bc-0;
widthbase[n]:=nextfmem+ec-bc+1;heightbase[n]:=widthbase[n]+0+nw;
depthbase[n]:=heightbase[n]+nh;nextfmem:=nextfmem+whdsize;{:1197};
{1199:}if lh<2 then goto 11;for jj:=4 downto 1 do get(tfminfile);
get(tfminfile);begin z:=tfminfile^;if z>127 then goto 11;get(tfminfile);
z:=z*256+tfminfile^;end;get(tfminfile);z:=z*256+tfminfile^;
get(tfminfile);z:=z*256+tfminfile^;
fontdsize[n]:=takefraction(z,267432584);
for jj:=4*(lh-2)downto 1 do get(tfminfile){:1199};
{1200:}ii:=widthbase[n]+0;i:=charbase[n]+0+bc;
while i<ii do begin get(tfminfile);fontinfo[i].qqqq.b0:=tfminfile^+0;
get(tfminfile);handd:=tfminfile^;fontinfo[i].qqqq.b1:=handd div 16;
fontinfo[i].qqqq.b2:=handd mod 16;get(tfminfile);get(tfminfile);i:=i+1;
end;while i<nextfmem do{1201:}begin get(tfminfile);d:=tfminfile^;
if d>=128 then d:=d-256;get(tfminfile);d:=d*256+tfminfile^;
get(tfminfile);d:=d*256+tfminfile^;get(tfminfile);d:=d*256+tfminfile^;
fontinfo[i].int:=takefraction(d*16,fontdsize[n]);i:=i+1;end{:1201};
if eof(tfminfile)then goto 11;goto 30{:1200}{:1195};
11:{1194:}begin if interaction=3 then;printnl(263);print(1143);end;
print(fname);if fileopened then print(1144)else print(1145);
begin helpptr:=3;helpline[2]:=1146;helpline[1]:=1147;helpline[0]:=1148;
end;if fileopened then helpline[0]:=1149;error{:1194};
30:if fileopened then bclose(tfminfile);
if n<>0 then begin fontpsname[n]:=fname;fontname[n]:=fname;
strref[fname]:=127;end;readfontinfo:=n;end;
{:1193}{1203:}function findfont(f:strnumber):fontnumber;label 10,40;
var n:fontnumber;
begin for n:=0 to lastfnum do if strvsstr(f,fontname[n])=0 then goto 40;
findfont:=readfontinfo(f);goto 10;40:findfont:=n;10:end;
{:1203}{1205:}procedure lostwarning(f:fontnumber;k:poolpointer);
begin if internal[11]>0 then begin begindiagnostic;printnl(1154);
print(strpool[k]);print(1155);print(fontname[f]);printchar(33);
enddiagnostic(false);end;end;
{:1205}{1206:}procedure settextbox(p:halfword);var f:fontnumber;
bc,ec:poolASCIIcode;k,kk:poolpointer;cc:fourquarters;h,d:scaled;
begin mem[p+7].int:=0;mem[p+9].int:=-2147483647;
mem[p+10].int:=-2147483647;f:=mem[p+1].hh.lh;bc:=fontbc[f];
ec:=fontec[f];kk:=strstart[nextstr[mem[p+1].hh.rh]];
k:=strstart[mem[p+1].hh.rh];
while k<kk do{1207:}begin if(strpool[k]<bc)or(strpool[k]>ec)then
lostwarning(f,k)else begin cc:=fontinfo[charbase[f]+strpool[k]].qqqq;
if not(cc.b0>0)then lostwarning(f,k)else begin mem[p+7].int:=mem[p+7].
int+fontinfo[widthbase[f]+cc.b0].int;
h:=fontinfo[heightbase[f]+cc.b1].int;
d:=fontinfo[depthbase[f]+cc.b2].int;
if h>mem[p+9].int then mem[p+9].int:=h;
if d>mem[p+10].int then mem[p+10].int:=d;end;end;k:=k+1;end{:1207};
{1208:}if mem[p+9].int<-mem[p+10].int then begin mem[p+9].int:=0;
mem[p+10].int:=0;end{:1208};end;
{:1206}function newtextnode(f,s:strnumber):halfword;var t:halfword;
begin t:=getnode(17);mem[t].hh.b0:=3;mem[t+1].hh.rh:=s;
mem[t+1].hh.lh:=findfont(f);mem[t+3].int:=0;mem[t+4].int:=0;
mem[t+5].int:=0;mem[t+6].int:=0;mem[t+2].hh.b0:=9;mem[t+8].hh.lh:=0;
mem[t+8].hh.rh:=0;mem[t+11].int:=0;mem[t+12].int:=0;
mem[t+13].int:=65536;mem[t+14].int:=0;mem[t+15].int:=0;
mem[t+16].int:=65536;settextbox(t);newtextnode:=t;end;
{:400}{401:}function newboundsnode(p:halfword;c:smallnumber):halfword;
var t:halfword;begin t:=getnode(grobjectsize[c]);mem[t].hh.b0:=c;
mem[t+1].hh.rh:=p;newboundsnode:=t;end;
{:401}{405:}procedure initbbox(h:halfword);begin mem[h+6].hh.rh:=h+7;
mem[h+6].hh.lh:=0;mem[h+2].int:=2147483647;mem[h+3].int:=2147483647;
mem[h+4].int:=-2147483647;mem[h+5].int:=-2147483647;end;
{:405}{406:}procedure initedges(h:halfword);begin mem[h].hh.rh:=2;
mem[h+7].hh.lh:=h+7;mem[h+7].hh.rh:=0;mem[h].hh.lh:=0;initbbox(h);end;
{:406}{411:}{414:}function copyobjects(p,q:halfword):halfword;
var hh:halfword;pp:halfword;k:smallnumber;begin hh:=getnode(8);
mem[hh].hh.rh:=2;mem[hh].hh.lh:=0;pp:=hh+7;
while(p<>q)do{415:}begin k:=grobjectsize[mem[p].hh.b0];
mem[pp].hh.rh:=getnode(k);pp:=mem[pp].hh.rh;while(k>0)do begin k:=k-1;
mem[pp+k]:=mem[p+k];end;
{416:}case mem[p].hh.b0 of 4,5:mem[pp+1].hh.rh:=copypath(mem[p+1].hh.rh)
;1:begin mem[pp+1].hh.rh:=copypath(mem[p+1].hh.rh);
if mem[p+1].hh.lh<>0 then mem[pp+1].hh.lh:=makepen(copypath(mem[p+1].hh.
lh),false);end;2:begin mem[pp+1].hh.rh:=copypath(mem[p+1].hh.rh);
mem[pp+1].hh.lh:=makepen(copypath(mem[p+1].hh.lh),false);
if mem[p+9].hh.rh<>0 then mem[mem[pp+9].hh.rh].hh.lh:=mem[mem[pp+9].hh.
rh].hh.lh+1;end;
3:begin if strref[mem[pp+1].hh.rh]<127 then strref[mem[pp+1].hh.rh]:=
strref[mem[pp+1].hh.rh]+1;end;6,7:;end{:416};p:=mem[p].hh.rh;end{:415};
mem[hh+7].hh.lh:=pp;mem[pp].hh.rh:=0;copyobjects:=hh;end;
{:414}function privateedges(h:halfword):halfword;var hh:halfword;
p,pp:halfword;
begin if mem[h].hh.lh=0 then privateedges:=h else begin mem[h].hh.lh:=
mem[h].hh.lh-1;hh:=copyobjects(mem[h+7].hh.rh,0);{412:}pp:=hh;
p:=mem[h].hh.rh;while(p<>2)do begin mem[pp].hh.rh:=getnode(3);
pp:=mem[pp].hh.rh;mem[pp+1].int:=mem[p+1].int;
mem[pp+2].int:=mem[p+2].int;p:=mem[p].hh.rh;end;mem[pp].hh.rh:=2;
mem[hh+1].int:=mem[h+1].int{:412};{413:}mem[hh+2].int:=mem[h+2].int;
mem[hh+3].int:=mem[h+3].int;mem[hh+4].int:=mem[h+4].int;
mem[hh+5].int:=mem[h+5].int;mem[hh+6].hh.lh:=mem[h+6].hh.lh;p:=h+7;
pp:=hh+7;while(p<>mem[h+6].hh.rh)do begin if p=0 then confusion(572);
p:=mem[p].hh.rh;pp:=mem[pp].hh.rh;end;mem[hh+6].hh.rh:=pp{:413};
privateedges:=hh;end;end;
{:411}{417:}function skip1component(p:halfword):halfword;
var lev:integer;begin lev:=0;
repeat if(mem[p].hh.b0>=4)then if(mem[p].hh.b0>=6)then lev:=lev-1 else
lev:=lev+1;p:=mem[p].hh.rh;until lev=0;skip1component:=p;end;
{:417}{430:}{432:}procedure xretraceerror;
begin begin if interaction=3 then;printnl(263);print(603);end;
begin helpptr:=3;helpline[2]:=607;helpline[1]:=608;helpline[0]:=606;end;
putgeterror;end;{:432}function makedashes(h:halfword):halfword;
label 10,40,45;var p:halfword;y0:scaled;p0:halfword;pp,qq,rr:halfword;
d,dd:halfword;{435:}x0,x1,x2,x3:scaled;{:435}{441:}dln:halfword;
hh:halfword;hsf:scaled;ds:halfword;xoff:scaled;
{:441}begin if mem[h].hh.rh<>2 then goto 40;p0:=0;p:=mem[h+7].hh.rh;
while p<>0 do begin if mem[p].hh.b0<>2 then{431:}begin begin if
interaction=3 then;printnl(263);print(603);end;begin helpptr:=3;
helpline[2]:=604;helpline[1]:=605;helpline[0]:=606;end;putgeterror;
goto 45;end{:431};pp:=mem[p+1].hh.rh;if p0=0 then begin p0:=p;
y0:=mem[pp+2].int;end;
{433:}{436:}if(mem[p+3].int<>mem[p0+3].int)or(mem[p+6].int<>mem[p0+6].
int)or(mem[p+4].int<>mem[p0+4].int)or(mem[p+5].int<>mem[p0+5].int)then
begin begin if interaction=3 then;printnl(263);print(603);end;
begin helpptr:=3;helpline[2]:=609;helpline[1]:=610;helpline[0]:=606;end;
putgeterror;goto 45;end{:436};rr:=pp;
if mem[pp].hh.rh<>pp then repeat qq:=rr;rr:=mem[rr].hh.rh;
{434:}x0:=mem[qq+1].int;x1:=mem[qq+5].int;x2:=mem[rr+3].int;
x3:=mem[rr+1].int;
if(x0>x1)or(x1>x2)or(x2>x3)then if(x0<x1)or(x1<x2)or(x2<x3)then if
abvscd(x2-x1,x2-x1,x1-x0,x3-x2)>0 then begin xretraceerror;goto 45;end;
if(mem[pp+1].int>x0)or(x0>x3)then if(mem[pp+1].int<x0)or(x0<x3)then
begin xretraceerror;goto 45;end{:434};until mem[rr].hh.b1=0;
d:=getnode(3);
if mem[p+9].hh.rh=0 then mem[d].hh.lh:=0 else mem[d].hh.lh:=p;
if mem[pp+1].int<mem[rr+1].int then begin mem[d+1].int:=mem[pp+1].int;
mem[d+2].int:=mem[rr+1].int;end else begin mem[d+1].int:=mem[rr+1].int;
mem[d+2].int:=mem[pp+1].int;end;{:433};{437:}mem[3].int:=mem[d+2].int;
dd:=h;while mem[mem[dd].hh.rh+1].int<mem[d+2].int do dd:=mem[dd].hh.rh;
if dd<>h then if(mem[dd+2].int>mem[d+1].int)then begin xretraceerror;
goto 45;end;mem[d].hh.rh:=mem[dd].hh.rh;mem[dd].hh.rh:=d{:437};
p:=mem[p].hh.rh;end;if mem[h].hh.rh=2 then goto 45;{440:}d:=h;
while mem[d].hh.rh<>2 do begin ds:=mem[mem[d].hh.rh].hh.lh;
if ds=0 then d:=mem[d].hh.rh else begin hh:=mem[ds+9].hh.rh;
hsf:=mem[ds+10].int;if(hh=0)then confusion(611);
if mem[hh+1].int=0 then d:=mem[d].hh.rh else begin if mem[hh].hh.rh=0
then confusion(611);{442:}dln:=mem[d].hh.rh;dd:=mem[hh].hh.rh;
xoff:=mem[dln+1].int-takescaled(hsf,mem[dd+1].int)-takescaled(hsf,
dashoffset(hh));
mem[3].int:=takescaled(hsf,mem[dd+1].int)+takescaled(hsf,mem[hh+1].int);
mem[4].int:=mem[3].int;
{443:}while xoff+takescaled(hsf,mem[dd+2].int)<mem[dln+1].int do dd:=mem
[dd].hh.rh{:443};
while mem[dln+1].int<=mem[dln+2].int do begin{444:}if dd=2 then begin dd
:=mem[hh].hh.rh;xoff:=xoff+takescaled(hsf,mem[hh+1].int);end{:444};
{445:}if xoff+takescaled(hsf,mem[dd+1].int)<=mem[dln+2].int then begin
mem[d].hh.rh:=getnode(3);d:=mem[d].hh.rh;mem[d].hh.rh:=dln;
if mem[dln+1].int>xoff+takescaled(hsf,mem[dd+1].int)then mem[d+1].int:=
mem[dln+1].int else mem[d+1].int:=xoff+takescaled(hsf,mem[dd+1].int);
if mem[dln+2].int<xoff+takescaled(hsf,mem[dd+2].int)then mem[d+2].int:=
mem[dln+2].int else mem[d+2].int:=xoff+takescaled(hsf,mem[dd+2].int);
end{:445};dd:=mem[dd].hh.rh;
mem[dln+1].int:=xoff+takescaled(hsf,mem[dd+1].int);end;
mem[d].hh.rh:=mem[dln].hh.rh;freenode(dln,3){:442};end;end;end{:440};
{438:}d:=mem[h].hh.rh;while(mem[d].hh.rh<>2)do d:=mem[d].hh.rh;
dd:=mem[h].hh.rh;mem[h+1].int:=mem[d+2].int-mem[dd+1].int;
if abs(y0)>mem[h+1].int then mem[h+1].int:=abs(y0)else if d<>dd then
begin mem[h].hh.rh:=mem[dd].hh.rh;
mem[d+2].int:=mem[dd+2].int+mem[h+1].int;freenode(dd,3);end{:438};
40:makedashes:=h;goto 10;45:{439:}flushdashlist(h);
if mem[h].hh.lh=0 then tossedges(h)else mem[h].hh.lh:=mem[h].hh.lh-1;
makedashes:=0{:439};10:end;{:430}{446:}procedure adjustbbox(h:halfword);
begin if bbmin[0]<mem[h+2].int then mem[h+2].int:=bbmin[0];
if bbmin[1]<mem[h+3].int then mem[h+3].int:=bbmin[1];
if bbmax[0]>mem[h+4].int then mem[h+4].int:=bbmax[0];
if bbmax[1]>mem[h+5].int then mem[h+5].int:=bbmax[1];end;
{:446}{447:}procedure boxends(p,pp,h:halfword);label 10;var q:halfword;
dx,dy:fraction;d:scaled;z:scaled;xx,yy:scaled;i:integer;
begin if mem[p].hh.b1<>0 then begin q:=mem[p].hh.rh;
while true do begin{448:}if q=mem[p].hh.rh then begin dx:=mem[p+1].int-
mem[p+5].int;dy:=mem[p+2].int-mem[p+6].int;
if(dx=0)and(dy=0)then begin dx:=mem[p+1].int-mem[q+3].int;
dy:=mem[p+2].int-mem[q+4].int;end;
end else begin dx:=mem[p+1].int-mem[p+3].int;
dy:=mem[p+2].int-mem[p+4].int;
if(dx=0)and(dy=0)then begin dx:=mem[p+1].int-mem[q+5].int;
dy:=mem[p+2].int-mem[q+6].int;end;end;dx:=mem[p+1].int-mem[q+1].int;
dy:=mem[p+2].int-mem[q+2].int{:448};d:=pythadd(dx,dy);
if d>0 then begin{449:}dx:=makefraction(dx,d);dy:=makefraction(dy,d);
findoffset(-dy,dx,pp);xx:=curx;yy:=cury{:449};
for i:=1 to 2 do begin{450:}findoffset(dx,dy,pp);
d:=takefraction(xx-curx,dx)+takefraction(yy-cury,dy);
if(d<0)and(i=1)or(d>0)and(i=2)then confusion(612);
z:=mem[p+1].int+curx+takefraction(d,dx);
if z<mem[h+2].int then mem[h+2].int:=z;
if z>mem[h+4].int then mem[h+4].int:=z;
z:=mem[p+2].int+cury+takefraction(d,dy);
if z<mem[h+3].int then mem[h+3].int:=z;
if z>mem[h+5].int then mem[h+5].int:=z{:450};dx:=-dx;dy:=-dy;end;end;
if mem[p].hh.b1=0 then goto 10 else{451:}repeat q:=p;p:=mem[p].hh.rh;
until mem[p].hh.b1=0{:451};end;end;10:;end;
{:447}{452:}procedure setbbox(h:halfword;toplevel:boolean);label 10;
var p:halfword;sminx,sminy,smaxx,smaxy:scaled;x0,x1,y0,y1:scaled;
lev:integer;begin{453:}case mem[h+6].hh.lh of 0:;
1:if internal[33]>0 then initbbox(h);
2:if internal[33]<=0 then initbbox(h);end{:453};
while mem[mem[h+6].hh.rh].hh.rh<>0 do begin p:=mem[mem[h+6].hh.rh].hh.rh
;mem[h+6].hh.rh:=p;
case mem[p].hh.b0 of 6:if toplevel then confusion(613)else goto 10;
{454:}1:begin pathbbox(mem[p+1].hh.rh);
if mem[p+1].hh.lh<>0 then begin x0:=bbmin[0];y0:=bbmin[1];x1:=bbmax[0];
y1:=bbmax[1];penbbox(mem[p+1].hh.lh);bbmin[0]:=bbmin[0]+x0;
bbmin[1]:=bbmin[1]+y0;bbmax[0]:=bbmax[0]+x1;bbmax[1]:=bbmax[1]+y1;end;
adjustbbox(h);end;
{:454}{455:}5:if internal[33]>0 then mem[h+6].hh.lh:=2 else begin mem[h
+6].hh.lh:=1;pathbbox(mem[p+1].hh.rh);adjustbbox(h);{456:}lev:=1;
while lev<>0 do begin if mem[p].hh.rh=0 then confusion(614);
p:=mem[p].hh.rh;
if mem[p].hh.b0=5 then lev:=lev+1 else if mem[p].hh.b0=7 then lev:=lev-1
;end;mem[h+6].hh.rh:=p{:456};end;
7:if internal[33]<=0 then confusion(614);
{:455}{457:}2:begin pathbbox(mem[p+1].hh.rh);x0:=bbmin[0];y0:=bbmin[1];
x1:=bbmax[0];y1:=bbmax[1];penbbox(mem[p+1].hh.lh);bbmin[0]:=bbmin[0]+x0;
bbmin[1]:=bbmin[1]+y0;bbmax[0]:=bbmax[0]+x1;bbmax[1]:=bbmax[1]+y1;
adjustbbox(h);
if(mem[mem[p+1].hh.rh].hh.b0=0)and(mem[p+9].hh.b0=2)then boxends(mem[p+1
].hh.rh,mem[p+1].hh.lh,h);end;
{:457}{458:}3:begin x1:=takescaled(mem[p+13].int,mem[p+7].int);
y0:=takescaled(mem[p+14].int,-mem[p+10].int);
y1:=takescaled(mem[p+14].int,mem[p+9].int);bbmin[0]:=mem[p+11].int;
bbmax[0]:=bbmin[0];if y0<y1 then begin bbmin[0]:=bbmin[0]+y0;
bbmax[0]:=bbmax[0]+y1;end else begin bbmin[0]:=bbmin[0]+y1;
bbmax[0]:=bbmax[0]+y0;end;
if x1<0 then bbmin[0]:=bbmin[0]+x1 else bbmax[0]:=bbmax[0]+x1;
x1:=takescaled(mem[p+15].int,mem[p+7].int);
y0:=takescaled(mem[p+16].int,-mem[p+10].int);
y1:=takescaled(mem[p+16].int,mem[p+9].int);bbmin[1]:=mem[p+12].int;
bbmax[1]:=bbmin[1];if y0<y1 then begin bbmin[1]:=bbmin[1]+y0;
bbmax[1]:=bbmax[1]+y1;end else begin bbmin[1]:=bbmin[1]+y1;
bbmax[1]:=bbmax[1]+y0;end;
if x1<0 then bbmin[1]:=bbmin[1]+x1 else bbmax[1]:=bbmax[1]+x1;
adjustbbox(h);end;{:458}{459:}4:begin pathbbox(mem[p+1].hh.rh);
x0:=bbmin[0];y0:=bbmin[1];x1:=bbmax[0];y1:=bbmax[1];sminx:=mem[h+2].int;
sminy:=mem[h+3].int;smaxx:=mem[h+4].int;smaxy:=mem[h+5].int;
{460:}mem[h+2].int:=2147483647;mem[h+3].int:=2147483647;
mem[h+4].int:=-2147483647;mem[h+5].int:=-2147483647;
setbbox(h,false){:460};{461:}if mem[h+2].int<x0 then mem[h+2].int:=x0;
if mem[h+3].int<y0 then mem[h+3].int:=y0;
if mem[h+4].int>x1 then mem[h+4].int:=x1;
if mem[h+5].int>y1 then mem[h+5].int:=y1{:461};bbmin[0]:=sminx;
bbmin[1]:=sminy;bbmax[0]:=smaxx;bbmax[1]:=smaxy;adjustbbox(h);end;
{:459}end;end;if not toplevel then confusion(613);10:end;
{:452}{464:}{471:}procedure splitcubic(p:halfword;t:fraction);
var v:scaled;q,r:halfword;begin q:=mem[p].hh.rh;r:=getnode(8);
mem[p].hh.rh:=r;mem[r].hh.rh:=q;mem[r+7].hh.b0:=0;mem[r].hh.b0:=1;
mem[r].hh.b1:=1;
v:=mem[p+5].int-takefraction(mem[p+5].int-mem[q+3].int,t);
mem[p+5].int:=mem[p+1].int-takefraction(mem[p+1].int-mem[p+5].int,t);
mem[q+3].int:=mem[q+3].int-takefraction(mem[q+3].int-mem[q+1].int,t);
mem[r+3].int:=mem[p+5].int-takefraction(mem[p+5].int-v,t);
mem[r+5].int:=v-takefraction(v-mem[q+3].int,t);
mem[r+1].int:=mem[r+3].int-takefraction(mem[r+3].int-mem[r+5].int,t);
v:=mem[p+6].int-takefraction(mem[p+6].int-mem[q+4].int,t);
mem[p+6].int:=mem[p+2].int-takefraction(mem[p+2].int-mem[p+6].int,t);
mem[q+4].int:=mem[q+4].int-takefraction(mem[q+4].int-mem[q+2].int,t);
mem[r+4].int:=mem[p+6].int-takefraction(mem[p+6].int-v,t);
mem[r+6].int:=v-takefraction(v-mem[q+4].int,t);
mem[r+2].int:=mem[r+4].int-takefraction(mem[r+4].int-mem[r+6].int,t);
end;{:471}{472:}procedure removecubic(p:halfword);var q:halfword;
begin q:=mem[p].hh.rh;mem[p].hh.rh:=mem[q].hh.rh;
mem[p+5].int:=mem[q+5].int;mem[p+6].int:=mem[q+6].int;freenode(q,8);end;
{:472}{474:}function penwalk(w:halfword;k:integer):halfword;
begin while k>0 do begin w:=mem[w].hh.rh;k:=k-1;end;
while k<0 do begin w:=mem[w].hh.lh;k:=k+1;end;penwalk:=w;end;
{:474}{477:}procedure finoffsetprep(p:halfword;w:halfword;
x0,x1,x2,y0,y1,y2:integer;rise,turnamt:integer);label 10;
var ww:halfword;du,dv:scaled;t0,t1,t2:integer;t:fraction;s:fraction;
v:integer;q:halfword;begin q:=mem[p].hh.rh;
while true do begin if rise>0 then ww:=mem[w].hh.rh else ww:=mem[w].hh.
lh;{478:}du:=mem[ww+1].int-mem[w+1].int;dv:=mem[ww+2].int-mem[w+2].int;
if abs(du)>=abs(dv)then begin s:=makefraction(dv,du);
t0:=takefraction(x0,s)-y0;t1:=takefraction(x1,s)-y1;
t2:=takefraction(x2,s)-y2;if du<0 then begin t0:=-t0;t1:=-t1;t2:=-t2;
end end else begin s:=makefraction(du,dv);t0:=x0-takefraction(y0,s);
t1:=x1-takefraction(y1,s);t2:=x2-takefraction(y2,s);
if dv<0 then begin t0:=-t0;t1:=-t1;t2:=-t2;end end;
if t0<0 then t0:=0{:478};t:=crossingpoint(t0,t1,t2);
if t>=268435456 then if turnamt>0 then t:=268435456 else goto 10;
{479:}begin splitcubic(p,t);p:=mem[p].hh.rh;mem[p].hh.lh:=16384+rise;
turnamt:=turnamt-1;v:=x0-takefraction(x0-x1,t);
x1:=x1-takefraction(x1-x2,t);x0:=v-takefraction(v-x1,t);
v:=y0-takefraction(y0-y1,t);y1:=y1-takefraction(y1-y2,t);
y0:=v-takefraction(v-y1,t);
if turnamt<0 then begin t1:=t1-takefraction(t1-t2,t);if t1>0 then t1:=0;
t:=crossingpoint(0,-t1,-t2);if t>268435456 then t:=268435456;
turnamt:=turnamt+1;
if(t=268435456)and(mem[p].hh.rh<>q)then mem[mem[p].hh.rh].hh.lh:=mem[mem
[p].hh.rh].hh.lh-rise else begin splitcubic(p,t);
mem[mem[p].hh.rh].hh.lh:=16384-rise;v:=x1-takefraction(x1-x2,t);
x1:=x0-takefraction(x0-x1,t);x2:=x1-takefraction(x1-v,t);
v:=y1-takefraction(y1-y2,t);y1:=y0-takefraction(y0-y1,t);
y2:=y1-takefraction(y1-v,t);end;end;end{:479};w:=ww;end;10:end;
{:477}{483:}function getturnamt(w:halfword;dx,dy:scaled;
ccw:boolean):integer;label 30;var ww:halfword;s:integer;t:integer;
begin s:=0;if ccw then begin ww:=mem[w].hh.rh;
repeat t:=abvscd(dy,mem[ww+1].int-mem[w+1].int,dx,mem[ww+2].int-mem[w+2]
.int);if t<0 then goto 30;s:=s+1;w:=ww;ww:=mem[ww].hh.rh;until t<=0;
30:end else begin ww:=mem[w].hh.lh;
while abvscd(dy,mem[w+1].int-mem[ww+1].int,dx,mem[w+2].int-mem[ww+2].int
)<0 do begin s:=s-1;w:=ww;ww:=mem[ww].hh.lh;end;end;getturnamt:=s;end;
{:483}function offsetprep(c,h:halfword):halfword;label 45;
var n:halfword;p,q,r,w,ww:halfword;kneeded:integer;w0:halfword;
dxin,dyin:scaled;turnamt:integer;{475:}x0,x1,x2,y0,y1,y2:integer;
t0,t1,t2:integer;du,dv,dx,dy:integer;dx0,dy0:integer;maxcoef:integer;
x0a,x1a,x2a,y0a,y1a,y2a:integer;t:fraction;s:fraction;
{:475}{488:}u0,u1,v0,v1:integer;ss:integer;dsign:-1..1;
{:488}begin{467:}n:=0;p:=h;repeat n:=n+1;p:=mem[p].hh.rh;
until p=h{:467};
{468:}dxin:=mem[mem[h].hh.rh+1].int-mem[mem[h].hh.lh+1].int;
dyin:=mem[mem[h].hh.rh+2].int-mem[mem[h].hh.lh+2].int;
if(dxin=0)and(dyin=0)then begin dxin:=mem[mem[h].hh.lh+2].int-mem[h+2].
int;dyin:=mem[h+1].int-mem[mem[h].hh.lh+1].int;end;w0:=h{:468};p:=c;
kneeded:=0;repeat q:=mem[p].hh.rh;{473:}mem[p].hh.lh:=16384+kneeded;
kneeded:=0;{476:}x0:=mem[p+5].int-mem[p+1].int;
x2:=mem[q+1].int-mem[q+3].int;x1:=mem[q+3].int-mem[p+5].int;
y0:=mem[p+6].int-mem[p+2].int;y2:=mem[q+2].int-mem[q+4].int;
y1:=mem[q+4].int-mem[p+6].int;maxcoef:=abs(x0);
if abs(x1)>maxcoef then maxcoef:=abs(x1);
if abs(x2)>maxcoef then maxcoef:=abs(x2);
if abs(y0)>maxcoef then maxcoef:=abs(y0);
if abs(y1)>maxcoef then maxcoef:=abs(y1);
if abs(y2)>maxcoef then maxcoef:=abs(y2);if maxcoef=0 then goto 45;
while maxcoef<134217728 do begin maxcoef:=maxcoef+maxcoef;x0:=x0+x0;
x1:=x1+x1;x2:=x2+x2;y0:=y0+y0;y1:=y1+y1;y2:=y2+y2;end{:476};
{480:}dx:=x0;dy:=y0;if dx=0 then if dy=0 then begin dx:=x1;dy:=y1;
if dx=0 then if dy=0 then begin dx:=x2;dy:=y2;end;end;
if p=c then begin dx0:=dx;dy0:=dy;end{:480};
{482:}turnamt:=getturnamt(w0,dx,dy,abvscd(dy,dxin,dx,dyin)>=0);
w:=penwalk(w0,turnamt);w0:=w;mem[p].hh.lh:=mem[p].hh.lh+turnamt{:482};
{481:}dxin:=x2;dyin:=y2;if dxin=0 then if dyin=0 then begin dxin:=x1;
dyin:=y1;if dxin=0 then if dyin=0 then begin dxin:=x0;dyin:=y0;end;
end{:481};{489:}dsign:=abvscd(dx,dyin,dxin,dy);
if dsign=0 then if dx=0 then if dy>0 then dsign:=1 else dsign:=-1 else
if dx>0 then dsign:=1 else dsign:=-1;
{490:}t0:=(takefraction(x0,y2))div 2-(takefraction(x2,y0))div 2;
t1:=(takefraction(x1,y0+y2))div 2-(takefraction(y1,x0+x2))div 2;
if t0=0 then t0:=dsign;if t0>0 then begin t:=crossingpoint(t0,t1,-t0);
u0:=x0-takefraction(x0-x1,t);u1:=x1-takefraction(x1-x2,t);
v0:=y0-takefraction(y0-y1,t);v1:=y1-takefraction(y1-y2,t);
end else begin t:=crossingpoint(-t0,t1,t0);u0:=x2-takefraction(x2-x1,t);
u1:=x1-takefraction(x1-x0,t);v0:=y2-takefraction(y2-y1,t);
v1:=y1-takefraction(y1-y0,t);end;
ss:=takefraction(x0+x2,u0-takefraction(u0-u1,t))+takefraction(y0+y2,v0-
takefraction(v0-v1,t)){:490};turnamt:=getturnamt(w,dxin,dyin,dsign>0);
if ss<0 then turnamt:=turnamt-dsign*n{:489};{485:}ww:=mem[w].hh.lh;
{478:}du:=mem[ww+1].int-mem[w+1].int;dv:=mem[ww+2].int-mem[w+2].int;
if abs(du)>=abs(dv)then begin s:=makefraction(dv,du);
t0:=takefraction(x0,s)-y0;t1:=takefraction(x1,s)-y1;
t2:=takefraction(x2,s)-y2;if du<0 then begin t0:=-t0;t1:=-t1;t2:=-t2;
end end else begin s:=makefraction(du,dv);t0:=x0-takefraction(y0,s);
t1:=x1-takefraction(y1,s);t2:=x2-takefraction(y2,s);
if dv<0 then begin t0:=-t0;t1:=-t1;t2:=-t2;end end;
if t0<0 then t0:=0{:478};{487:}t:=crossingpoint(t0,t1,t2);
if turnamt>=0 then if t2<0 then t:=268435457 else begin u0:=x0-
takefraction(x0-x1,t);u1:=x1-takefraction(x1-x2,t);
ss:=takefraction(-du,u0-takefraction(u0-u1,t));
v0:=y0-takefraction(y0-y1,t);v1:=y1-takefraction(y1-y2,t);
ss:=ss+takefraction(-dv,v0-takefraction(v0-v1,t));
if ss<0 then t:=268435457;end else if t>268435456 then t:=268435456;
{:487};
if t>268435456 then finoffsetprep(p,w,x0,x1,x2,y0,y1,y2,1,turnamt)else
begin splitcubic(p,t);r:=mem[p].hh.rh;x1a:=x0-takefraction(x0-x1,t);
x1:=x1-takefraction(x1-x2,t);x2a:=x1a-takefraction(x1a-x1,t);
y1a:=y0-takefraction(y0-y1,t);y1:=y1-takefraction(y1-y2,t);
y2a:=y1a-takefraction(y1a-y1,t);
finoffsetprep(p,w,x0,x1a,x2a,y0,y1a,y2a,1,0);x0:=x2a;y0:=y2a;
mem[r].hh.lh:=16383;
if turnamt>=0 then begin t1:=t1-takefraction(t1-t2,t);
if t1>0 then t1:=0;t:=crossingpoint(0,-t1,-t2);
if t>268435456 then t:=268435456;{486:}splitcubic(r,t);
mem[mem[r].hh.rh].hh.lh:=16385;x1a:=x1-takefraction(x1-x2,t);
x1:=x0-takefraction(x0-x1,t);x0a:=x1-takefraction(x1-x1a,t);
y1a:=y1-takefraction(y1-y2,t);y1:=y0-takefraction(y0-y1,t);
y0a:=y1-takefraction(y1-y1a,t);
finoffsetprep(mem[r].hh.rh,w,x0a,x1a,x2,y0a,y1a,y2,1,turnamt);x2:=x0a;
y2:=y0a{:486};finoffsetprep(r,ww,x0,x1,x2,y0,y1,y2,-1,0);
end else finoffsetprep(r,ww,x0,x1,x2,y0,y1,y2,-1,-1-turnamt);end{:485};
w0:=penwalk(w0,turnamt);45:{:473};{469:}repeat r:=mem[p].hh.rh;
if mem[p+1].int=mem[p+5].int then if mem[p+2].int=mem[p+6].int then if
mem[p+1].int=mem[r+3].int then if mem[p+2].int=mem[r+4].int then if mem[
p+1].int=mem[r+1].int then if mem[p+2].int=mem[r+2].int then if r<>p
then if((r<>q)or(mem[r+7].hh.b0<>1))then{470:}begin kneeded:=mem[p].hh.
lh-16384;if r=q then q:=p else begin mem[p].hh.lh:=kneeded+mem[r].hh.lh;
kneeded:=0;end;if r=c then begin mem[p].hh.lh:=mem[c].hh.lh;c:=p;end;
if r=specp1 then specp1:=p;if r=specp2 then specp2:=p;r:=p;
removecubic(p);end{:470};p:=r;until p=q{:469};until q=c;
{484:}specoffset:=mem[c].hh.lh-16384;
if mem[c].hh.rh=c then mem[c].hh.lh:=16384+n else begin mem[c].hh.lh:=
mem[c].hh.lh+kneeded;while w0<>h do begin mem[c].hh.lh:=mem[c].hh.lh+1;
w0:=mem[w0].hh.rh;end;
while mem[c].hh.lh<=16384-n do mem[c].hh.lh:=mem[c].hh.lh+n;
while mem[c].hh.lh>16384 do mem[c].hh.lh:=mem[c].hh.lh-n;
if(mem[c].hh.lh<>16384)and(abvscd(dy0,dxin,dx0,dyin)>=0)then mem[c].hh.
lh:=mem[c].hh.lh+n;end;offsetprep:=c{:484};end;
{:464}{491:}procedure printspec(curspec,curpen:halfword;s:strnumber);
var p,q:halfword;w:halfword;begin printdiagnostic(615,s,true);
p:=curspec;w:=penwalk(curpen,specoffset);println;
printtwo(mem[curspec+1].int,mem[curspec+2].int);print(616);
printtwo(mem[w+1].int,mem[w+2].int);repeat repeat q:=mem[p].hh.rh;
{493:}begin printnl(621);printtwo(mem[p+5].int,mem[p+6].int);print(558);
printtwo(mem[q+3].int,mem[q+4].int);printnl(555);
printtwo(mem[q+1].int,mem[q+2].int);end{:493};p:=q;
until(p=curspec)or(mem[p].hh.lh<>16384);
if mem[p].hh.lh<>16384 then{492:}begin w:=penwalk(w,mem[p].hh.lh-16384);
print(618);if mem[p].hh.lh>16384 then print(619);print(620);
printtwo(mem[w+1].int,mem[w+2].int);end{:492};until p=curspec;
printnl(617);enddiagnostic(true);end;
{:491}{494:}{501:}function insertknot(q:halfword;x,y:scaled):halfword;
var r:halfword;begin r:=getnode(8);mem[r].hh.rh:=mem[q].hh.rh;
mem[q].hh.rh:=r;mem[r+5].int:=mem[q+5].int;mem[r+6].int:=mem[q+6].int;
mem[r+1].int:=x;mem[r+2].int:=y;mem[q+5].int:=mem[q+1].int;
mem[q+6].int:=mem[q+2].int;mem[r+3].int:=mem[r+1].int;
mem[r+4].int:=mem[r+2].int;mem[r].hh.b0:=1;mem[r].hh.b1:=1;
mem[r+7].hh.b0:=0;insertknot:=r;end;
{:501}function makeenvelope(c,h:halfword;ljoin,lcap:smallnumber;
miterlim:scaled):halfword;label 30;var p,q,r,q0:halfword;jointype:0..3;
w,w0:halfword;qx,qy:scaled;k,k0:halfword;
{498:}dxin,dyin,dxout,dyout:fraction;tmp:scaled;
{:498}{504:}det:fraction;{:504}{506:}htx,hty:fraction;maxht:scaled;
kk:halfword;ww:halfword;{:506}begin specp1:=0;specp2:=0;
if mem[c].hh.b0=0 then{509:}begin specp1:=htapypoc(c);specp2:=pathtail;
mem[specp1+7].hh.b0:=0;mem[specp2].hh.rh:=mem[specp1].hh.rh;
mem[specp1].hh.rh:=c;removecubic(specp1);c:=specp1;
if c<>mem[c].hh.rh then begin mem[specp2+7].hh.b0:=0;
removecubic(specp2);end else{510:}begin mem[c].hh.b0:=1;mem[c].hh.b1:=1;
mem[c+3].int:=mem[c+1].int;mem[c+4].int:=mem[c+2].int;
mem[c+5].int:=mem[c+1].int;mem[c+6].int:=mem[c+2].int;end;{:510};
end{:509};{495:}c:=offsetprep(c,h);
if internal[5]>0 then printspec(c,h,287);h:=penwalk(h,specoffset){:495};
w:=h;p:=c;repeat q:=mem[p].hh.rh;q0:=q;qx:=mem[q+1].int;
qy:=mem[q+2].int;k:=mem[q].hh.lh;k0:=k;w0:=w;
if k<>16384 then{496:}if k<16384 then jointype:=2 else begin if(q<>
specp1)and(q<>specp2)then jointype:=ljoin else if lcap=2 then jointype:=
3 else jointype:=2-lcap;
if(jointype=0)or(jointype=3)then begin{511:}dxin:=mem[q+1].int-mem[q+3].
int;dyin:=mem[q+2].int-mem[q+4].int;
if(dxin=0)and(dyin=0)then begin dxin:=mem[q+1].int-mem[p+5].int;
dyin:=mem[q+2].int-mem[p+6].int;
if(dxin=0)and(dyin=0)then begin dxin:=mem[q+1].int-mem[p+1].int;
dyin:=mem[q+2].int-mem[p+2].int;
if p<>c then begin dxin:=dxin+mem[w+1].int;dyin:=dyin+mem[w+2].int;end;
end;end;tmp:=pythadd(dxin,dyin);
if tmp=0 then jointype:=2 else begin dxin:=makefraction(dxin,tmp);
dyin:=makefraction(dyin,tmp);{512:}dxout:=mem[q+5].int-mem[q+1].int;
dyout:=mem[q+6].int-mem[q+2].int;
if(dxout=0)and(dyout=0)then begin r:=mem[q].hh.rh;
dxout:=mem[r+3].int-mem[q+1].int;dyout:=mem[r+4].int-mem[q+2].int;
if(dxout=0)and(dyout=0)then begin dxout:=mem[r+1].int-mem[q+1].int;
dyout:=mem[r+2].int-mem[q+2].int;end;end;
if q=c then begin dxout:=dxout-mem[h+1].int;dyout:=dyout-mem[h+2].int;
end;tmp:=pythadd(dxout,dyout);if tmp=0 then confusion(622);
dxout:=makefraction(dxout,tmp);dyout:=makefraction(dyout,tmp){:512};
end{:511};
if jointype=0 then{497:}begin tmp:=takefraction(miterlim,134217728+(
takefraction(dxin,dxout)+takefraction(dyin,dyout))div 2);
if tmp<65536 then if takescaled(miterlim,tmp)<65536 then jointype:=2;
end{:497};end;end{:496};{499:}mem[p+5].int:=mem[p+5].int+mem[w+1].int;
mem[p+6].int:=mem[p+6].int+mem[w+2].int;
mem[q+3].int:=mem[q+3].int+mem[w+1].int;
mem[q+4].int:=mem[q+4].int+mem[w+2].int;
mem[q+1].int:=mem[q+1].int+mem[w+1].int;
mem[q+2].int:=mem[q+2].int+mem[w+2].int;mem[q].hh.b0:=1;
mem[q].hh.b1:=1{:499};
while k<>16384 do begin{500:}if k>16384 then begin w:=mem[w].hh.rh;
k:=k-1;end else begin w:=mem[w].hh.lh;k:=k+1;end{:500};
if(jointype=1)or(k=16384)then q:=insertknot(q,qx+mem[w+1].int,qy+mem[w+2
].int);end;if q<>mem[p].hh.rh then{502:}begin p:=mem[p].hh.rh;
if(jointype=0)or(jointype=3)then begin if jointype=0 then{503:}begin det
:=takefraction(dyout,dxin)-takefraction(dxout,dyin);
if abs(det)<26844 then r:=0 else begin tmp:=takefraction(mem[q+1].int-
mem[p+1].int,dyout)-takefraction(mem[q+2].int-mem[p+2].int,dxout);
tmp:=makefraction(tmp,det);
r:=insertknot(p,mem[p+1].int+takefraction(tmp,dxin),mem[p+2].int+
takefraction(tmp,dyin));end;
end{:503}else{505:}begin htx:=mem[w+2].int-mem[w0+2].int;
hty:=mem[w0+1].int-mem[w+1].int;
while(abs(htx)<134217728)and(abs(hty)<134217728)do begin htx:=htx+htx;
hty:=hty+hty;end;{507:}maxht:=0;kk:=16384;ww:=w;
while true do begin{508:}if kk>k0 then begin ww:=mem[ww].hh.rh;kk:=kk-1;
end else begin ww:=mem[ww].hh.lh;kk:=kk+1;end{:508};
if kk=k0 then goto 30;
tmp:=takefraction(mem[ww+1].int-mem[w0+1].int,htx)+takefraction(mem[ww+2
].int-mem[w0+2].int,hty);if tmp>maxht then maxht:=tmp;end;30:{:507};
tmp:=makefraction(maxht,takefraction(dxin,htx)+takefraction(dyin,hty));
r:=insertknot(p,mem[p+1].int+takefraction(tmp,dxin),mem[p+2].int+
takefraction(tmp,dyin));
tmp:=makefraction(maxht,takefraction(dxout,htx)+takefraction(dyout,hty))
;r:=insertknot(r,mem[q+1].int+takefraction(tmp,dxout),mem[q+2].int+
takefraction(tmp,dyout));end{:505};
if r<>0 then begin mem[r+5].int:=mem[r+1].int;
mem[r+6].int:=mem[r+2].int;end;end;end{:502};p:=q;until q0=c;
makeenvelope:=c;end;{:494}{514:}function finddirectiontime(x,y:scaled;
h:halfword):scaled;label 10,40,45,30;var max:scaled;p,q:halfword;
n:scaled;tt:scaled;{517:}x1,x2,x3,y1,y2,y3:scaled;theta,phi:angle;
t:fraction;
{:517}begin{515:}if abs(x)<abs(y)then begin x:=makefraction(x,abs(y));
if y>0 then y:=268435456 else y:=-268435456;
end else if x=0 then begin finddirectiontime:=0;goto 10;
end else begin y:=makefraction(y,abs(x));
if x>0 then x:=268435456 else x:=-268435456;end{:515};n:=0;p:=h;
while true do begin if mem[p].hh.b1=0 then goto 45;q:=mem[p].hh.rh;
{516:}tt:=0;{518:}x1:=mem[p+5].int-mem[p+1].int;
x2:=mem[q+3].int-mem[p+5].int;x3:=mem[q+1].int-mem[q+3].int;
y1:=mem[p+6].int-mem[p+2].int;y2:=mem[q+4].int-mem[p+6].int;
y3:=mem[q+2].int-mem[q+4].int;max:=abs(x1);
if abs(x2)>max then max:=abs(x2);if abs(x3)>max then max:=abs(x3);
if abs(y1)>max then max:=abs(y1);if abs(y2)>max then max:=abs(y2);
if abs(y3)>max then max:=abs(y3);if max=0 then goto 40;
while max<134217728 do begin max:=max+max;x1:=x1+x1;x2:=x2+x2;x3:=x3+x3;
y1:=y1+y1;y2:=y2+y2;y3:=y3+y3;end;t:=x1;
x1:=takefraction(x1,x)+takefraction(y1,y);
y1:=takefraction(y1,x)-takefraction(t,y);t:=x2;
x2:=takefraction(x2,x)+takefraction(y2,y);
y2:=takefraction(y2,x)-takefraction(t,y);t:=x3;
x3:=takefraction(x3,x)+takefraction(y3,y);
y3:=takefraction(y3,x)-takefraction(t,y){:518};
if y1=0 then if x1>=0 then goto 40;
if n>0 then begin{519:}theta:=narg(x1,y1);
if theta>=0 then if phi<=0 then if phi>=theta-188743680 then goto 40;
if theta<=0 then if phi>=0 then if phi<=theta+188743680 then goto 40
{:519};if p=h then goto 45;end;if(x3<>0)or(y3<>0)then phi:=narg(x3,y3);
{521:}if x1<0 then if x2<0 then if x3<0 then goto 30;
if abvscd(y1,y3,y2,y2)=0 then{523:}begin if abvscd(y1,y2,0,0)<0 then
begin t:=makefraction(y1,y1-y2);x1:=x1-takefraction(x1-x2,t);
x2:=x2-takefraction(x2-x3,t);
if x1-takefraction(x1-x2,t)>=0 then begin tt:=(t+2048)div 4096;goto 40;
end;
end else if y3=0 then if y1=0 then{524:}begin t:=crossingpoint(-x1,-x2,-
x3);if t<=268435456 then begin tt:=(t+2048)div 4096;goto 40;end;
if abvscd(x1,x3,x2,x2)<=0 then begin t:=makefraction(x1,x1-x2);
begin tt:=(t+2048)div 4096;goto 40;end;end;
end{:524}else if x3>=0 then begin tt:=65536;goto 40;end;goto 30;
end{:523};if y1<=0 then if y1<0 then begin y1:=-y1;y2:=-y2;y3:=-y3;
end else if y2>0 then begin y2:=-y2;y3:=-y3;end;
{522:}t:=crossingpoint(y1,y2,y3);if t>268435456 then goto 30;
y2:=y2-takefraction(y2-y3,t);x1:=x1-takefraction(x1-x2,t);
x2:=x2-takefraction(x2-x3,t);x1:=x1-takefraction(x1-x2,t);
if x1>=0 then begin tt:=(t+2048)div 4096;goto 40;end;if y2>0 then y2:=0;
tt:=t;t:=crossingpoint(0,-y2,-y3);if t>268435456 then goto 30;
x1:=x1-takefraction(x1-x2,t);x2:=x2-takefraction(x2-x3,t);
if x1-takefraction(x1-x2,t)>=0 then begin t:=tt-takefraction(tt
-268435456,t);begin tt:=(t+2048)div 4096;goto 40;end;end{:522};
30:{:521}{:516};p:=q;n:=n+65536;end;45:finddirectiontime:=-65536;
goto 10;40:finddirectiontime:=n+tt;10:end;
{:514}{532:}procedure cubicintersection(p,pp:halfword);label 22,45,10;
var q,qq:halfword;begin timetogo:=5000;maxt:=2;{534:}q:=mem[p].hh.rh;
qq:=mem[pp].hh.rh;bisectptr:=20;
bisectstack[bisectptr-5]:=mem[p+5].int-mem[p+1].int;
bisectstack[bisectptr-4]:=mem[q+3].int-mem[p+5].int;
bisectstack[bisectptr-3]:=mem[q+1].int-mem[q+3].int;
if bisectstack[bisectptr-5]<0 then if bisectstack[bisectptr-3]>=0 then
begin if bisectstack[bisectptr-4]<0 then bisectstack[bisectptr-2]:=
bisectstack[bisectptr-5]+bisectstack[bisectptr-4]else bisectstack[
bisectptr-2]:=bisectstack[bisectptr-5];
bisectstack[bisectptr-1]:=bisectstack[bisectptr-5]+bisectstack[bisectptr
-4]+bisectstack[bisectptr-3];
if bisectstack[bisectptr-1]<0 then bisectstack[bisectptr-1]:=0;
end else begin bisectstack[bisectptr-2]:=bisectstack[bisectptr-5]+
bisectstack[bisectptr-4]+bisectstack[bisectptr-3];
if bisectstack[bisectptr-2]>bisectstack[bisectptr-5]then bisectstack[
bisectptr-2]:=bisectstack[bisectptr-5];
bisectstack[bisectptr-1]:=bisectstack[bisectptr-5]+bisectstack[bisectptr
-4];if bisectstack[bisectptr-1]<0 then bisectstack[bisectptr-1]:=0;
end else if bisectstack[bisectptr-3]<=0 then begin if bisectstack[
bisectptr-4]>0 then bisectstack[bisectptr-1]:=bisectstack[bisectptr-5]+
bisectstack[bisectptr-4]else bisectstack[bisectptr-1]:=bisectstack[
bisectptr-5];
bisectstack[bisectptr-2]:=bisectstack[bisectptr-5]+bisectstack[bisectptr
-4]+bisectstack[bisectptr-3];
if bisectstack[bisectptr-2]>0 then bisectstack[bisectptr-2]:=0;
end else begin bisectstack[bisectptr-1]:=bisectstack[bisectptr-5]+
bisectstack[bisectptr-4]+bisectstack[bisectptr-3];
if bisectstack[bisectptr-1]<bisectstack[bisectptr-5]then bisectstack[
bisectptr-1]:=bisectstack[bisectptr-5];
bisectstack[bisectptr-2]:=bisectstack[bisectptr-5]+bisectstack[bisectptr
-4];if bisectstack[bisectptr-2]>0 then bisectstack[bisectptr-2]:=0;end;
bisectstack[bisectptr-10]:=mem[p+6].int-mem[p+2].int;
bisectstack[bisectptr-9]:=mem[q+4].int-mem[p+6].int;
bisectstack[bisectptr-8]:=mem[q+2].int-mem[q+4].int;
if bisectstack[bisectptr-10]<0 then if bisectstack[bisectptr-8]>=0 then
begin if bisectstack[bisectptr-9]<0 then bisectstack[bisectptr-7]:=
bisectstack[bisectptr-10]+bisectstack[bisectptr-9]else bisectstack[
bisectptr-7]:=bisectstack[bisectptr-10];
bisectstack[bisectptr-6]:=bisectstack[bisectptr-10]+bisectstack[
bisectptr-9]+bisectstack[bisectptr-8];
if bisectstack[bisectptr-6]<0 then bisectstack[bisectptr-6]:=0;
end else begin bisectstack[bisectptr-7]:=bisectstack[bisectptr-10]+
bisectstack[bisectptr-9]+bisectstack[bisectptr-8];
if bisectstack[bisectptr-7]>bisectstack[bisectptr-10]then bisectstack[
bisectptr-7]:=bisectstack[bisectptr-10];
bisectstack[bisectptr-6]:=bisectstack[bisectptr-10]+bisectstack[
bisectptr-9];
if bisectstack[bisectptr-6]<0 then bisectstack[bisectptr-6]:=0;
end else if bisectstack[bisectptr-8]<=0 then begin if bisectstack[
bisectptr-9]>0 then bisectstack[bisectptr-6]:=bisectstack[bisectptr-10]+
bisectstack[bisectptr-9]else bisectstack[bisectptr-6]:=bisectstack[
bisectptr-10];
bisectstack[bisectptr-7]:=bisectstack[bisectptr-10]+bisectstack[
bisectptr-9]+bisectstack[bisectptr-8];
if bisectstack[bisectptr-7]>0 then bisectstack[bisectptr-7]:=0;
end else begin bisectstack[bisectptr-6]:=bisectstack[bisectptr-10]+
bisectstack[bisectptr-9]+bisectstack[bisectptr-8];
if bisectstack[bisectptr-6]<bisectstack[bisectptr-10]then bisectstack[
bisectptr-6]:=bisectstack[bisectptr-10];
bisectstack[bisectptr-7]:=bisectstack[bisectptr-10]+bisectstack[
bisectptr-9];
if bisectstack[bisectptr-7]>0 then bisectstack[bisectptr-7]:=0;end;
bisectstack[bisectptr-15]:=mem[pp+5].int-mem[pp+1].int;
bisectstack[bisectptr-14]:=mem[qq+3].int-mem[pp+5].int;
bisectstack[bisectptr-13]:=mem[qq+1].int-mem[qq+3].int;
if bisectstack[bisectptr-15]<0 then if bisectstack[bisectptr-13]>=0 then
begin if bisectstack[bisectptr-14]<0 then bisectstack[bisectptr-12]:=
bisectstack[bisectptr-15]+bisectstack[bisectptr-14]else bisectstack[
bisectptr-12]:=bisectstack[bisectptr-15];
bisectstack[bisectptr-11]:=bisectstack[bisectptr-15]+bisectstack[
bisectptr-14]+bisectstack[bisectptr-13];
if bisectstack[bisectptr-11]<0 then bisectstack[bisectptr-11]:=0;
end else begin bisectstack[bisectptr-12]:=bisectstack[bisectptr-15]+
bisectstack[bisectptr-14]+bisectstack[bisectptr-13];
if bisectstack[bisectptr-12]>bisectstack[bisectptr-15]then bisectstack[
bisectptr-12]:=bisectstack[bisectptr-15];
bisectstack[bisectptr-11]:=bisectstack[bisectptr-15]+bisectstack[
bisectptr-14];
if bisectstack[bisectptr-11]<0 then bisectstack[bisectptr-11]:=0;
end else if bisectstack[bisectptr-13]<=0 then begin if bisectstack[
bisectptr-14]>0 then bisectstack[bisectptr-11]:=bisectstack[bisectptr-15
]+bisectstack[bisectptr-14]else bisectstack[bisectptr-11]:=bisectstack[
bisectptr-15];
bisectstack[bisectptr-12]:=bisectstack[bisectptr-15]+bisectstack[
bisectptr-14]+bisectstack[bisectptr-13];
if bisectstack[bisectptr-12]>0 then bisectstack[bisectptr-12]:=0;
end else begin bisectstack[bisectptr-11]:=bisectstack[bisectptr-15]+
bisectstack[bisectptr-14]+bisectstack[bisectptr-13];
if bisectstack[bisectptr-11]<bisectstack[bisectptr-15]then bisectstack[
bisectptr-11]:=bisectstack[bisectptr-15];
bisectstack[bisectptr-12]:=bisectstack[bisectptr-15]+bisectstack[
bisectptr-14];
if bisectstack[bisectptr-12]>0 then bisectstack[bisectptr-12]:=0;end;
bisectstack[bisectptr-20]:=mem[pp+6].int-mem[pp+2].int;
bisectstack[bisectptr-19]:=mem[qq+4].int-mem[pp+6].int;
bisectstack[bisectptr-18]:=mem[qq+2].int-mem[qq+4].int;
if bisectstack[bisectptr-20]<0 then if bisectstack[bisectptr-18]>=0 then
begin if bisectstack[bisectptr-19]<0 then bisectstack[bisectptr-17]:=
bisectstack[bisectptr-20]+bisectstack[bisectptr-19]else bisectstack[
bisectptr-17]:=bisectstack[bisectptr-20];
bisectstack[bisectptr-16]:=bisectstack[bisectptr-20]+bisectstack[
bisectptr-19]+bisectstack[bisectptr-18];
if bisectstack[bisectptr-16]<0 then bisectstack[bisectptr-16]:=0;
end else begin bisectstack[bisectptr-17]:=bisectstack[bisectptr-20]+
bisectstack[bisectptr-19]+bisectstack[bisectptr-18];
if bisectstack[bisectptr-17]>bisectstack[bisectptr-20]then bisectstack[
bisectptr-17]:=bisectstack[bisectptr-20];
bisectstack[bisectptr-16]:=bisectstack[bisectptr-20]+bisectstack[
bisectptr-19];
if bisectstack[bisectptr-16]<0 then bisectstack[bisectptr-16]:=0;
end else if bisectstack[bisectptr-18]<=0 then begin if bisectstack[
bisectptr-19]>0 then bisectstack[bisectptr-16]:=bisectstack[bisectptr-20
]+bisectstack[bisectptr-19]else bisectstack[bisectptr-16]:=bisectstack[
bisectptr-20];
bisectstack[bisectptr-17]:=bisectstack[bisectptr-20]+bisectstack[
bisectptr-19]+bisectstack[bisectptr-18];
if bisectstack[bisectptr-17]>0 then bisectstack[bisectptr-17]:=0;
end else begin bisectstack[bisectptr-16]:=bisectstack[bisectptr-20]+
bisectstack[bisectptr-19]+bisectstack[bisectptr-18];
if bisectstack[bisectptr-16]<bisectstack[bisectptr-20]then bisectstack[
bisectptr-16]:=bisectstack[bisectptr-20];
bisectstack[bisectptr-17]:=bisectstack[bisectptr-20]+bisectstack[
bisectptr-19];
if bisectstack[bisectptr-17]>0 then bisectstack[bisectptr-17]:=0;end;
delx:=mem[p+1].int-mem[pp+1].int;dely:=mem[p+2].int-mem[pp+2].int;
tol:=0;uv:=bisectptr;xy:=bisectptr;threel:=0;curt:=1;curtt:=1{:534};
while true do begin 22:if delx-tol<=bisectstack[xy-11]-bisectstack[uv-2]
then if delx+tol>=bisectstack[xy-12]-bisectstack[uv-1]then if dely-tol<=
bisectstack[xy-16]-bisectstack[uv-7]then if dely+tol>=bisectstack[xy-17]
-bisectstack[uv-6]then begin if curt>=maxt then begin if maxt=131072
then begin curt:=(curt+1)div 2;curtt:=(curtt+1)div 2;goto 10;end;
maxt:=maxt+maxt;apprt:=curt;apprtt:=curtt;end;
{535:}bisectstack[bisectptr]:=delx;bisectstack[bisectptr+1]:=dely;
bisectstack[bisectptr+2]:=tol;bisectstack[bisectptr+3]:=uv;
bisectstack[bisectptr+4]:=xy;bisectptr:=bisectptr+45;curt:=curt+curt;
curtt:=curtt+curtt;bisectstack[bisectptr-25]:=bisectstack[uv-5];
bisectstack[bisectptr-3]:=bisectstack[uv-3];
bisectstack[bisectptr-24]:=(bisectstack[bisectptr-25]+bisectstack[uv-4])
div 2;
bisectstack[bisectptr-4]:=(bisectstack[bisectptr-3]+bisectstack[uv-4])
div 2;bisectstack[bisectptr-23]:=(bisectstack[bisectptr-24]+bisectstack[
bisectptr-4])div 2;bisectstack[bisectptr-5]:=bisectstack[bisectptr-23];
if bisectstack[bisectptr-25]<0 then if bisectstack[bisectptr-23]>=0 then
begin if bisectstack[bisectptr-24]<0 then bisectstack[bisectptr-22]:=
bisectstack[bisectptr-25]+bisectstack[bisectptr-24]else bisectstack[
bisectptr-22]:=bisectstack[bisectptr-25];
bisectstack[bisectptr-21]:=bisectstack[bisectptr-25]+bisectstack[
bisectptr-24]+bisectstack[bisectptr-23];
if bisectstack[bisectptr-21]<0 then bisectstack[bisectptr-21]:=0;
end else begin bisectstack[bisectptr-22]:=bisectstack[bisectptr-25]+
bisectstack[bisectptr-24]+bisectstack[bisectptr-23];
if bisectstack[bisectptr-22]>bisectstack[bisectptr-25]then bisectstack[
bisectptr-22]:=bisectstack[bisectptr-25];
bisectstack[bisectptr-21]:=bisectstack[bisectptr-25]+bisectstack[
bisectptr-24];
if bisectstack[bisectptr-21]<0 then bisectstack[bisectptr-21]:=0;
end else if bisectstack[bisectptr-23]<=0 then begin if bisectstack[
bisectptr-24]>0 then bisectstack[bisectptr-21]:=bisectstack[bisectptr-25
]+bisectstack[bisectptr-24]else bisectstack[bisectptr-21]:=bisectstack[
bisectptr-25];
bisectstack[bisectptr-22]:=bisectstack[bisectptr-25]+bisectstack[
bisectptr-24]+bisectstack[bisectptr-23];
if bisectstack[bisectptr-22]>0 then bisectstack[bisectptr-22]:=0;
end else begin bisectstack[bisectptr-21]:=bisectstack[bisectptr-25]+
bisectstack[bisectptr-24]+bisectstack[bisectptr-23];
if bisectstack[bisectptr-21]<bisectstack[bisectptr-25]then bisectstack[
bisectptr-21]:=bisectstack[bisectptr-25];
bisectstack[bisectptr-22]:=bisectstack[bisectptr-25]+bisectstack[
bisectptr-24];
if bisectstack[bisectptr-22]>0 then bisectstack[bisectptr-22]:=0;end;
if bisectstack[bisectptr-5]<0 then if bisectstack[bisectptr-3]>=0 then
begin if bisectstack[bisectptr-4]<0 then bisectstack[bisectptr-2]:=
bisectstack[bisectptr-5]+bisectstack[bisectptr-4]else bisectstack[
bisectptr-2]:=bisectstack[bisectptr-5];
bisectstack[bisectptr-1]:=bisectstack[bisectptr-5]+bisectstack[bisectptr
-4]+bisectstack[bisectptr-3];
if bisectstack[bisectptr-1]<0 then bisectstack[bisectptr-1]:=0;
end else begin bisectstack[bisectptr-2]:=bisectstack[bisectptr-5]+
bisectstack[bisectptr-4]+bisectstack[bisectptr-3];
if bisectstack[bisectptr-2]>bisectstack[bisectptr-5]then bisectstack[
bisectptr-2]:=bisectstack[bisectptr-5];
bisectstack[bisectptr-1]:=bisectstack[bisectptr-5]+bisectstack[bisectptr
-4];if bisectstack[bisectptr-1]<0 then bisectstack[bisectptr-1]:=0;
end else if bisectstack[bisectptr-3]<=0 then begin if bisectstack[
bisectptr-4]>0 then bisectstack[bisectptr-1]:=bisectstack[bisectptr-5]+
bisectstack[bisectptr-4]else bisectstack[bisectptr-1]:=bisectstack[
bisectptr-5];
bisectstack[bisectptr-2]:=bisectstack[bisectptr-5]+bisectstack[bisectptr
-4]+bisectstack[bisectptr-3];
if bisectstack[bisectptr-2]>0 then bisectstack[bisectptr-2]:=0;
end else begin bisectstack[bisectptr-1]:=bisectstack[bisectptr-5]+
bisectstack[bisectptr-4]+bisectstack[bisectptr-3];
if bisectstack[bisectptr-1]<bisectstack[bisectptr-5]then bisectstack[
bisectptr-1]:=bisectstack[bisectptr-5];
bisectstack[bisectptr-2]:=bisectstack[bisectptr-5]+bisectstack[bisectptr
-4];if bisectstack[bisectptr-2]>0 then bisectstack[bisectptr-2]:=0;end;
bisectstack[bisectptr-30]:=bisectstack[uv-10];
bisectstack[bisectptr-8]:=bisectstack[uv-8];
bisectstack[bisectptr-29]:=(bisectstack[bisectptr-30]+bisectstack[uv-9])
div 2;
bisectstack[bisectptr-9]:=(bisectstack[bisectptr-8]+bisectstack[uv-9])
div 2;bisectstack[bisectptr-28]:=(bisectstack[bisectptr-29]+bisectstack[
bisectptr-9])div 2;bisectstack[bisectptr-10]:=bisectstack[bisectptr-28];
if bisectstack[bisectptr-30]<0 then if bisectstack[bisectptr-28]>=0 then
begin if bisectstack[bisectptr-29]<0 then bisectstack[bisectptr-27]:=
bisectstack[bisectptr-30]+bisectstack[bisectptr-29]else bisectstack[
bisectptr-27]:=bisectstack[bisectptr-30];
bisectstack[bisectptr-26]:=bisectstack[bisectptr-30]+bisectstack[
bisectptr-29]+bisectstack[bisectptr-28];
if bisectstack[bisectptr-26]<0 then bisectstack[bisectptr-26]:=0;
end else begin bisectstack[bisectptr-27]:=bisectstack[bisectptr-30]+
bisectstack[bisectptr-29]+bisectstack[bisectptr-28];
if bisectstack[bisectptr-27]>bisectstack[bisectptr-30]then bisectstack[
bisectptr-27]:=bisectstack[bisectptr-30];
bisectstack[bisectptr-26]:=bisectstack[bisectptr-30]+bisectstack[
bisectptr-29];
if bisectstack[bisectptr-26]<0 then bisectstack[bisectptr-26]:=0;
end else if bisectstack[bisectptr-28]<=0 then begin if bisectstack[
bisectptr-29]>0 then bisectstack[bisectptr-26]:=bisectstack[bisectptr-30
]+bisectstack[bisectptr-29]else bisectstack[bisectptr-26]:=bisectstack[
bisectptr-30];
bisectstack[bisectptr-27]:=bisectstack[bisectptr-30]+bisectstack[
bisectptr-29]+bisectstack[bisectptr-28];
if bisectstack[bisectptr-27]>0 then bisectstack[bisectptr-27]:=0;
end else begin bisectstack[bisectptr-26]:=bisectstack[bisectptr-30]+
bisectstack[bisectptr-29]+bisectstack[bisectptr-28];
if bisectstack[bisectptr-26]<bisectstack[bisectptr-30]then bisectstack[
bisectptr-26]:=bisectstack[bisectptr-30];
bisectstack[bisectptr-27]:=bisectstack[bisectptr-30]+bisectstack[
bisectptr-29];
if bisectstack[bisectptr-27]>0 then bisectstack[bisectptr-27]:=0;end;
if bisectstack[bisectptr-10]<0 then if bisectstack[bisectptr-8]>=0 then
begin if bisectstack[bisectptr-9]<0 then bisectstack[bisectptr-7]:=
bisectstack[bisectptr-10]+bisectstack[bisectptr-9]else bisectstack[
bisectptr-7]:=bisectstack[bisectptr-10];
bisectstack[bisectptr-6]:=bisectstack[bisectptr-10]+bisectstack[
bisectptr-9]+bisectstack[bisectptr-8];
if bisectstack[bisectptr-6]<0 then bisectstack[bisectptr-6]:=0;
end else begin bisectstack[bisectptr-7]:=bisectstack[bisectptr-10]+
bisectstack[bisectptr-9]+bisectstack[bisectptr-8];
if bisectstack[bisectptr-7]>bisectstack[bisectptr-10]then bisectstack[
bisectptr-7]:=bisectstack[bisectptr-10];
bisectstack[bisectptr-6]:=bisectstack[bisectptr-10]+bisectstack[
bisectptr-9];
if bisectstack[bisectptr-6]<0 then bisectstack[bisectptr-6]:=0;
end else if bisectstack[bisectptr-8]<=0 then begin if bisectstack[
bisectptr-9]>0 then bisectstack[bisectptr-6]:=bisectstack[bisectptr-10]+
bisectstack[bisectptr-9]else bisectstack[bisectptr-6]:=bisectstack[
bisectptr-10];
bisectstack[bisectptr-7]:=bisectstack[bisectptr-10]+bisectstack[
bisectptr-9]+bisectstack[bisectptr-8];
if bisectstack[bisectptr-7]>0 then bisectstack[bisectptr-7]:=0;
end else begin bisectstack[bisectptr-6]:=bisectstack[bisectptr-10]+
bisectstack[bisectptr-9]+bisectstack[bisectptr-8];
if bisectstack[bisectptr-6]<bisectstack[bisectptr-10]then bisectstack[
bisectptr-6]:=bisectstack[bisectptr-10];
bisectstack[bisectptr-7]:=bisectstack[bisectptr-10]+bisectstack[
bisectptr-9];
if bisectstack[bisectptr-7]>0 then bisectstack[bisectptr-7]:=0;end;
bisectstack[bisectptr-35]:=bisectstack[xy-15];
bisectstack[bisectptr-13]:=bisectstack[xy-13];
bisectstack[bisectptr-34]:=(bisectstack[bisectptr-35]+bisectstack[xy-14]
)div 2;
bisectstack[bisectptr-14]:=(bisectstack[bisectptr-13]+bisectstack[xy-14]
)div 2;
bisectstack[bisectptr-33]:=(bisectstack[bisectptr-34]+bisectstack[
bisectptr-14])div 2;
bisectstack[bisectptr-15]:=bisectstack[bisectptr-33];
if bisectstack[bisectptr-35]<0 then if bisectstack[bisectptr-33]>=0 then
begin if bisectstack[bisectptr-34]<0 then bisectstack[bisectptr-32]:=
bisectstack[bisectptr-35]+bisectstack[bisectptr-34]else bisectstack[
bisectptr-32]:=bisectstack[bisectptr-35];
bisectstack[bisectptr-31]:=bisectstack[bisectptr-35]+bisectstack[
bisectptr-34]+bisectstack[bisectptr-33];
if bisectstack[bisectptr-31]<0 then bisectstack[bisectptr-31]:=0;
end else begin bisectstack[bisectptr-32]:=bisectstack[bisectptr-35]+
bisectstack[bisectptr-34]+bisectstack[bisectptr-33];
if bisectstack[bisectptr-32]>bisectstack[bisectptr-35]then bisectstack[
bisectptr-32]:=bisectstack[bisectptr-35];
bisectstack[bisectptr-31]:=bisectstack[bisectptr-35]+bisectstack[
bisectptr-34];
if bisectstack[bisectptr-31]<0 then bisectstack[bisectptr-31]:=0;
end else if bisectstack[bisectptr-33]<=0 then begin if bisectstack[
bisectptr-34]>0 then bisectstack[bisectptr-31]:=bisectstack[bisectptr-35
]+bisectstack[bisectptr-34]else bisectstack[bisectptr-31]:=bisectstack[
bisectptr-35];
bisectstack[bisectptr-32]:=bisectstack[bisectptr-35]+bisectstack[
bisectptr-34]+bisectstack[bisectptr-33];
if bisectstack[bisectptr-32]>0 then bisectstack[bisectptr-32]:=0;
end else begin bisectstack[bisectptr-31]:=bisectstack[bisectptr-35]+
bisectstack[bisectptr-34]+bisectstack[bisectptr-33];
if bisectstack[bisectptr-31]<bisectstack[bisectptr-35]then bisectstack[
bisectptr-31]:=bisectstack[bisectptr-35];
bisectstack[bisectptr-32]:=bisectstack[bisectptr-35]+bisectstack[
bisectptr-34];
if bisectstack[bisectptr-32]>0 then bisectstack[bisectptr-32]:=0;end;
if bisectstack[bisectptr-15]<0 then if bisectstack[bisectptr-13]>=0 then
begin if bisectstack[bisectptr-14]<0 then bisectstack[bisectptr-12]:=
bisectstack[bisectptr-15]+bisectstack[bisectptr-14]else bisectstack[
bisectptr-12]:=bisectstack[bisectptr-15];
bisectstack[bisectptr-11]:=bisectstack[bisectptr-15]+bisectstack[
bisectptr-14]+bisectstack[bisectptr-13];
if bisectstack[bisectptr-11]<0 then bisectstack[bisectptr-11]:=0;
end else begin bisectstack[bisectptr-12]:=bisectstack[bisectptr-15]+
bisectstack[bisectptr-14]+bisectstack[bisectptr-13];
if bisectstack[bisectptr-12]>bisectstack[bisectptr-15]then bisectstack[
bisectptr-12]:=bisectstack[bisectptr-15];
bisectstack[bisectptr-11]:=bisectstack[bisectptr-15]+bisectstack[
bisectptr-14];
if bisectstack[bisectptr-11]<0 then bisectstack[bisectptr-11]:=0;
end else if bisectstack[bisectptr-13]<=0 then begin if bisectstack[
bisectptr-14]>0 then bisectstack[bisectptr-11]:=bisectstack[bisectptr-15
]+bisectstack[bisectptr-14]else bisectstack[bisectptr-11]:=bisectstack[
bisectptr-15];
bisectstack[bisectptr-12]:=bisectstack[bisectptr-15]+bisectstack[
bisectptr-14]+bisectstack[bisectptr-13];
if bisectstack[bisectptr-12]>0 then bisectstack[bisectptr-12]:=0;
end else begin bisectstack[bisectptr-11]:=bisectstack[bisectptr-15]+
bisectstack[bisectptr-14]+bisectstack[bisectptr-13];
if bisectstack[bisectptr-11]<bisectstack[bisectptr-15]then bisectstack[
bisectptr-11]:=bisectstack[bisectptr-15];
bisectstack[bisectptr-12]:=bisectstack[bisectptr-15]+bisectstack[
bisectptr-14];
if bisectstack[bisectptr-12]>0 then bisectstack[bisectptr-12]:=0;end;
bisectstack[bisectptr-40]:=bisectstack[xy-20];
bisectstack[bisectptr-18]:=bisectstack[xy-18];
bisectstack[bisectptr-39]:=(bisectstack[bisectptr-40]+bisectstack[xy-19]
)div 2;
bisectstack[bisectptr-19]:=(bisectstack[bisectptr-18]+bisectstack[xy-19]
)div 2;
bisectstack[bisectptr-38]:=(bisectstack[bisectptr-39]+bisectstack[
bisectptr-19])div 2;
bisectstack[bisectptr-20]:=bisectstack[bisectptr-38];
if bisectstack[bisectptr-40]<0 then if bisectstack[bisectptr-38]>=0 then
begin if bisectstack[bisectptr-39]<0 then bisectstack[bisectptr-37]:=
bisectstack[bisectptr-40]+bisectstack[bisectptr-39]else bisectstack[
bisectptr-37]:=bisectstack[bisectptr-40];
bisectstack[bisectptr-36]:=bisectstack[bisectptr-40]+bisectstack[
bisectptr-39]+bisectstack[bisectptr-38];
if bisectstack[bisectptr-36]<0 then bisectstack[bisectptr-36]:=0;
end else begin bisectstack[bisectptr-37]:=bisectstack[bisectptr-40]+
bisectstack[bisectptr-39]+bisectstack[bisectptr-38];
if bisectstack[bisectptr-37]>bisectstack[bisectptr-40]then bisectstack[
bisectptr-37]:=bisectstack[bisectptr-40];
bisectstack[bisectptr-36]:=bisectstack[bisectptr-40]+bisectstack[
bisectptr-39];
if bisectstack[bisectptr-36]<0 then bisectstack[bisectptr-36]:=0;
end else if bisectstack[bisectptr-38]<=0 then begin if bisectstack[
bisectptr-39]>0 then bisectstack[bisectptr-36]:=bisectstack[bisectptr-40
]+bisectstack[bisectptr-39]else bisectstack[bisectptr-36]:=bisectstack[
bisectptr-40];
bisectstack[bisectptr-37]:=bisectstack[bisectptr-40]+bisectstack[
bisectptr-39]+bisectstack[bisectptr-38];
if bisectstack[bisectptr-37]>0 then bisectstack[bisectptr-37]:=0;
end else begin bisectstack[bisectptr-36]:=bisectstack[bisectptr-40]+
bisectstack[bisectptr-39]+bisectstack[bisectptr-38];
if bisectstack[bisectptr-36]<bisectstack[bisectptr-40]then bisectstack[
bisectptr-36]:=bisectstack[bisectptr-40];
bisectstack[bisectptr-37]:=bisectstack[bisectptr-40]+bisectstack[
bisectptr-39];
if bisectstack[bisectptr-37]>0 then bisectstack[bisectptr-37]:=0;end;
if bisectstack[bisectptr-20]<0 then if bisectstack[bisectptr-18]>=0 then
begin if bisectstack[bisectptr-19]<0 then bisectstack[bisectptr-17]:=
bisectstack[bisectptr-20]+bisectstack[bisectptr-19]else bisectstack[
bisectptr-17]:=bisectstack[bisectptr-20];
bisectstack[bisectptr-16]:=bisectstack[bisectptr-20]+bisectstack[
bisectptr-19]+bisectstack[bisectptr-18];
if bisectstack[bisectptr-16]<0 then bisectstack[bisectptr-16]:=0;
end else begin bisectstack[bisectptr-17]:=bisectstack[bisectptr-20]+
bisectstack[bisectptr-19]+bisectstack[bisectptr-18];
if bisectstack[bisectptr-17]>bisectstack[bisectptr-20]then bisectstack[
bisectptr-17]:=bisectstack[bisectptr-20];
bisectstack[bisectptr-16]:=bisectstack[bisectptr-20]+bisectstack[
bisectptr-19];
if bisectstack[bisectptr-16]<0 then bisectstack[bisectptr-16]:=0;
end else if bisectstack[bisectptr-18]<=0 then begin if bisectstack[
bisectptr-19]>0 then bisectstack[bisectptr-16]:=bisectstack[bisectptr-20
]+bisectstack[bisectptr-19]else bisectstack[bisectptr-16]:=bisectstack[
bisectptr-20];
bisectstack[bisectptr-17]:=bisectstack[bisectptr-20]+bisectstack[
bisectptr-19]+bisectstack[bisectptr-18];
if bisectstack[bisectptr-17]>0 then bisectstack[bisectptr-17]:=0;
end else begin bisectstack[bisectptr-16]:=bisectstack[bisectptr-20]+
bisectstack[bisectptr-19]+bisectstack[bisectptr-18];
if bisectstack[bisectptr-16]<bisectstack[bisectptr-20]then bisectstack[
bisectptr-16]:=bisectstack[bisectptr-20];
bisectstack[bisectptr-17]:=bisectstack[bisectptr-20]+bisectstack[
bisectptr-19];
if bisectstack[bisectptr-17]>0 then bisectstack[bisectptr-17]:=0;end;
uv:=bisectptr-20;xy:=bisectptr-20;delx:=delx+delx;dely:=dely+dely;
tol:=tol-threel+tolstep;tol:=tol+tol;threel:=threel+tolstep{:535};
goto 22;end;
if timetogo>0 then timetogo:=timetogo-1 else begin while apprt<65536 do
begin apprt:=apprt+apprt;apprtt:=apprtt+apprtt;end;curt:=apprt;
curtt:=apprtt;goto 10;end;
{536:}45:if odd(curtt)then if odd(curt)then{537:}begin curt:=(curt)div 2
;curtt:=(curtt)div 2;if curt=0 then goto 10;bisectptr:=bisectptr-45;
threel:=threel-tolstep;delx:=bisectstack[bisectptr];
dely:=bisectstack[bisectptr+1];tol:=bisectstack[bisectptr+2];
uv:=bisectstack[bisectptr+3];xy:=bisectstack[bisectptr+4];goto 45;
end{:537}else begin curt:=curt+1;
delx:=delx+bisectstack[uv-5]+bisectstack[uv-4]+bisectstack[uv-3];
dely:=dely+bisectstack[uv-10]+bisectstack[uv-9]+bisectstack[uv-8];
uv:=uv+20;curtt:=curtt-1;xy:=xy-20;
delx:=delx+bisectstack[xy-15]+bisectstack[xy-14]+bisectstack[xy-13];
dely:=dely+bisectstack[xy-20]+bisectstack[xy-19]+bisectstack[xy-18];
end else begin curtt:=curtt+1;tol:=tol+threel;
delx:=delx-bisectstack[xy-15]-bisectstack[xy-14]-bisectstack[xy-13];
dely:=dely-bisectstack[xy-20]-bisectstack[xy-19]-bisectstack[xy-18];
xy:=xy+20;end{:536};end;10:end;
{:532}{538:}procedure pathintersection(h,hh:halfword);label 10;
var p,pp:halfword;n,nn:integer;
begin{539:}if mem[h].hh.b1=0 then begin mem[h+5].int:=mem[h+1].int;
mem[h+3].int:=mem[h+1].int;mem[h+6].int:=mem[h+2].int;
mem[h+4].int:=mem[h+2].int;mem[h].hh.b1:=1;end;
if mem[hh].hh.b1=0 then begin mem[hh+5].int:=mem[hh+1].int;
mem[hh+3].int:=mem[hh+1].int;mem[hh+6].int:=mem[hh+2].int;
mem[hh+4].int:=mem[hh+2].int;mem[hh].hh.b1:=1;end;{:539};tolstep:=0;
repeat n:=-65536;p:=h;repeat if mem[p].hh.b1<>0 then begin nn:=-65536;
pp:=hh;repeat if mem[pp].hh.b1<>0 then begin cubicintersection(p,pp);
if curt>0 then begin curt:=curt+n;curtt:=curtt+nn;goto 10;end;end;
nn:=nn+65536;pp:=mem[pp].hh.rh;until pp=hh;end;n:=n+65536;
p:=mem[p].hh.rh;until p=h;tolstep:=tolstep+3;until tolstep>3;
curt:=-65536;curtt:=-65536;10:end;
{:538}{546:}function maxcoef(p:halfword):fraction;var x:fraction;
begin x:=0;
while mem[p].hh.lh<>0 do begin if abs(mem[p+1].int)>x then x:=abs(mem[p
+1].int);p:=mem[p].hh.rh;end;maxcoef:=x;end;
{:546}{552:}function pplusq(p:halfword;q:halfword;
t:smallnumber):halfword;label 30;var pp,qq:halfword;r,s:halfword;
threshold:integer;v:integer;
begin if t=18 then threshold:=2685 else threshold:=8;r:=29999;
pp:=mem[p].hh.lh;qq:=mem[q].hh.lh;
while true do if pp=qq then if pp=0 then goto 30 else{553:}begin v:=mem[
p+1].int+mem[q+1].int;mem[p+1].int:=v;s:=p;p:=mem[p].hh.rh;
pp:=mem[p].hh.lh;
if abs(v)<threshold then freenode(s,2)else begin if abs(v)>=626349397
then if watchcoefs then begin mem[qq].hh.b0:=0;fixneeded:=true;end;
mem[r].hh.rh:=s;r:=s;end;q:=mem[q].hh.rh;qq:=mem[q].hh.lh;
end{:553}else if mem[pp+1].int<mem[qq+1].int then begin s:=getnode(2);
mem[s].hh.lh:=qq;mem[s+1].int:=mem[q+1].int;q:=mem[q].hh.rh;
qq:=mem[q].hh.lh;mem[r].hh.rh:=s;r:=s;end else begin mem[r].hh.rh:=p;
r:=p;p:=mem[p].hh.rh;pp:=mem[p].hh.lh;end;
30:mem[p+1].int:=slowadd(mem[p+1].int,mem[q+1].int);mem[r].hh.rh:=p;
depfinal:=p;pplusq:=mem[29999].hh.rh;end;
{:552}{554:}function ptimesv(p:halfword;v:integer;t0,t1:smallnumber;
visscaled:boolean):halfword;var r,s:halfword;w:integer;
threshold:integer;scalingdown:boolean;
begin if t0<>t1 then scalingdown:=true else scalingdown:=not visscaled;
if t1=18 then threshold:=1342 else threshold:=4;r:=29999;
while mem[p].hh.lh<>0 do begin if scalingdown then w:=takefraction(v,mem
[p+1].int)else w:=takescaled(v,mem[p+1].int);
if abs(w)<=threshold then begin s:=mem[p].hh.rh;freenode(p,2);p:=s;
end else begin if abs(w)>=626349397 then begin fixneeded:=true;
mem[mem[p].hh.lh].hh.b0:=0;end;mem[r].hh.rh:=p;r:=p;mem[p+1].int:=w;
p:=mem[p].hh.rh;end;end;mem[r].hh.rh:=p;
if visscaled then mem[p+1].int:=takescaled(mem[p+1].int,v)else mem[p+1].
int:=takefraction(mem[p+1].int,v);ptimesv:=mem[29999].hh.rh;end;
{:554}{556:}function pwithxbecomingq(p,x,q:halfword;
t:smallnumber):halfword;var r,s:halfword;v:integer;sx:integer;
begin s:=p;r:=29999;sx:=mem[x+1].int;
while mem[mem[s].hh.lh+1].int>sx do begin r:=s;s:=mem[s].hh.rh;end;
if mem[s].hh.lh<>x then pwithxbecomingq:=p else begin mem[29999].hh.rh:=
p;mem[r].hh.rh:=mem[s].hh.rh;v:=mem[s+1].int;freenode(s,2);
pwithxbecomingq:=pplusfq(mem[29999].hh.rh,v,q,t,18);end;end;
{:556}{561:}procedure newdep(q,p:halfword);var r:halfword;
begin mem[q+1].hh.rh:=p;mem[q+1].hh.lh:=5;r:=mem[5].hh.rh;
mem[depfinal].hh.rh:=r;mem[r+1].hh.lh:=depfinal;mem[5].hh.rh:=q;end;
{:561}{562:}function constdependency(v:scaled):halfword;
begin depfinal:=getnode(2);mem[depfinal+1].int:=v;
mem[depfinal].hh.lh:=0;constdependency:=depfinal;end;
{:562}{563:}function singledependency(p:halfword):halfword;
var q:halfword;m:integer;begin m:=mem[p+1].int mod 64;
if m>28 then singledependency:=constdependency(0)else begin q:=getnode(2
);mem[q+1].int:=twotothe[28-m];mem[q].hh.lh:=p;
mem[q].hh.rh:=constdependency(0);singledependency:=q;end;end;
{:563}{564:}function copydeplist(p:halfword):halfword;label 30;
var q:halfword;begin q:=getnode(2);depfinal:=q;
while true do begin mem[depfinal].hh.lh:=mem[p].hh.lh;
mem[depfinal+1].int:=mem[p+1].int;if mem[depfinal].hh.lh=0 then goto 30;
mem[depfinal].hh.rh:=getnode(2);depfinal:=mem[depfinal].hh.rh;
p:=mem[p].hh.rh;end;30:copydeplist:=q;end;
{:564}{565:}procedure lineareq(p:halfword;t:smallnumber);
var q,r,s:halfword;x:halfword;n:integer;v:integer;prevr:halfword;
finalnode:halfword;w:integer;begin{566:}q:=p;r:=mem[p].hh.rh;
v:=mem[q+1].int;
while mem[r].hh.lh<>0 do begin if abs(mem[r+1].int)>abs(v)then begin q:=
r;v:=mem[r+1].int;end;r:=mem[r].hh.rh;end{:566};x:=mem[q].hh.lh;
n:=mem[x+1].int mod 64;{567:}s:=29999;mem[s].hh.rh:=p;r:=p;
repeat if r=q then begin mem[s].hh.rh:=mem[r].hh.rh;freenode(r,2);
end else begin w:=makefraction(mem[r+1].int,v);
if abs(w)<=1342 then begin mem[s].hh.rh:=mem[r].hh.rh;freenode(r,2);
end else begin mem[r+1].int:=-w;s:=r;end;end;r:=mem[s].hh.rh;
until mem[r].hh.lh=0;
if t=19 then mem[r+1].int:=-makescaled(mem[r+1].int,v)else if v<>
-268435456 then mem[r+1].int:=-makefraction(mem[r+1].int,v);
finalnode:=r;p:=mem[29999].hh.rh{:567};
if internal[2]>0 then{568:}if interesting(x)then begin begindiagnostic;
printnl(632);printvariablename(x);w:=n;while w>0 do begin print(625);
w:=w-2;end;printchar(61);printdependency(p,18);enddiagnostic(false);
end{:568};{569:}prevr:=5;r:=mem[5].hh.rh;
while r<>5 do begin s:=mem[r+1].hh.rh;
q:=pwithxbecomingq(s,x,p,mem[r].hh.b0);
if mem[q].hh.lh=0 then makeknown(r,q)else begin mem[r+1].hh.rh:=q;
repeat q:=mem[q].hh.rh;until mem[q].hh.lh=0;prevr:=q;end;
r:=mem[prevr].hh.rh;end{:569};{570:}if n>0 then{571:}begin s:=29999;
mem[29999].hh.rh:=p;r:=p;
repeat if n>30 then w:=0 else w:=mem[r+1].int div twotothe[n];
if(abs(w)<=1342)and(mem[r].hh.lh<>0)then begin mem[s].hh.rh:=mem[r].hh.
rh;freenode(r,2);end else begin mem[r+1].int:=w;s:=r;end;
r:=mem[s].hh.rh;until mem[s].hh.lh=0;p:=mem[29999].hh.rh;end{:571};
if mem[p].hh.lh=0 then begin mem[x].hh.b0:=17;
mem[x+1].int:=mem[p+1].int;
if abs(mem[x+1].int)>=268435456 then valtoobig(mem[x+1].int);
freenode(p,2);
if curexp=x then if curtype=20 then begin curexp:=mem[x+1].int;
curtype:=17;freenode(x,2);end;end else begin mem[x].hh.b0:=18;
depfinal:=finalnode;newdep(x,p);
if curexp=x then if curtype=20 then curtype:=18;end{:570};
if fixneeded then fixdependencies;end;
{:565}{574:}function newringentry(p:halfword):halfword;var q:halfword;
begin q:=getnode(2);mem[q].hh.b1:=19;mem[q].hh.b0:=mem[p].hh.b0;
if mem[p+1].int=0 then mem[q+1].int:=p else mem[q+1].int:=mem[p+1].int;
mem[p+1].int:=q;newringentry:=q;end;
{:574}{576:}procedure nonlineareq(v:integer;p:halfword;flushp:boolean);
var t:smallnumber;q,r:halfword;begin t:=mem[p].hh.b0-1;q:=mem[p+1].int;
if flushp then mem[p].hh.b0:=1 else p:=q;repeat r:=mem[q+1].int;
mem[q].hh.b0:=t;case t of 2:mem[q+1].int:=v;4:begin mem[q+1].int:=v;
begin if strref[v]<127 then strref[v]:=strref[v]+1;end;end;
6:mem[q+1].int:=makepen(copypath(v),false);8:mem[q+1].int:=copypath(v);
10:begin mem[q+1].int:=v;mem[v].hh.lh:=mem[v].hh.lh+1;end;end;q:=r;
until q=p;end;{:576}{577:}procedure ringmerge(p,q:halfword);label 10;
var r:halfword;begin r:=mem[p+1].int;
while r<>p do begin if r=q then begin{578:}begin begin if interaction=3
then;printnl(263);print(635);end;begin helpptr:=2;helpline[1]:=636;
helpline[0]:=637;end;putgeterror;end{:578};goto 10;end;r:=mem[r+1].int;
end;r:=mem[p+1].int;mem[p+1].int:=mem[q+1].int;mem[q+1].int:=r;10:end;
{:577}{581:}procedure showcmdmod(c,m:integer);begin begindiagnostic;
printnl(123);printcmdmod(c,m);printchar(125);enddiagnostic(false);end;
{:581}{591:}procedure showcontext;label 30;var oldsetting:0..10;
{597:}i:0..bufsize;l:integer;m:integer;n:0..errorline;p:integer;
q:integer;{:597}begin fileptr:=inputptr;inputstack[fileptr]:=curinput;
while true do begin curinput:=inputstack[fileptr];
{592:}if(fileptr=inputptr)or(curinput.indexfield<=6)or(curinput.
indexfield<>10)or(curinput.locfield<>0)then begin tally:=0;
oldsetting:=selector;
if(curinput.indexfield<=6)then begin{593:}if curinput.namefield>2 then
begin printnl(639);printint(trueline);
end else if(curinput.namefield=0)then if fileptr=0 then printnl(640)else
printnl(641)else if curinput.namefield=2 then printnl(642)else printnl(
643);printchar(32){:593};{600:}begin l:=tally;tally:=0;selector:=6;
trickcount:=1000000;end;
if curinput.limitfield>0 then for i:=curinput.startfield to curinput.
limitfield-1 do begin if i=curinput.locfield then begin firstcount:=
tally;trickcount:=tally+1+errorline-halferrorline;
if trickcount<errorline then trickcount:=errorline;end;print(buffer[i]);
end{:600};
end else begin{594:}case curinput.indexfield of 7:printnl(644);
8:{595:}begin printnl(649);p:=paramstack[curinput.limitfield];
if p<>0 then if mem[p].hh.rh=1 then printexp(p,0)else showtokenlist(p,0,
20,tally);print(650);end{:595};9:printnl(645);
10:if curinput.locfield=0 then printnl(646)else printnl(647);
11:printnl(648);12:begin println;
if curinput.namefield<>0 then print(hash[curinput.namefield].rh)else
{596:}begin p:=paramstack[curinput.limitfield];
if p=0 then showtokenlist(paramstack[curinput.limitfield+1],0,20,tally)
else begin q:=p;while mem[q].hh.rh<>0 do q:=mem[q].hh.rh;
mem[q].hh.rh:=paramstack[curinput.limitfield+1];
showtokenlist(p,0,20,tally);mem[q].hh.rh:=0;end;end{:596};print(529);
end;others:printnl(63)end{:594};{601:}begin l:=tally;tally:=0;
selector:=6;trickcount:=1000000;end;
if curinput.indexfield<>12 then showtokenlist(curinput.startfield,
curinput.locfield,100000,0)else showmacro(curinput.startfield,curinput.
locfield,100000){:601};end;selector:=oldsetting;
{599:}if trickcount=1000000 then begin firstcount:=tally;
trickcount:=tally+1+errorline-halferrorline;
if trickcount<errorline then trickcount:=errorline;end;
if tally<trickcount then m:=tally-firstcount else m:=trickcount-
firstcount;if l+firstcount<=halferrorline then begin p:=0;
n:=l+firstcount;end else begin print(278);
p:=l+firstcount-halferrorline+3;n:=halferrorline;end;
for q:=p to firstcount-1 do printchar(trickbuf[q mod errorline]);
println;for q:=1 to n do printchar(32);
if m+n<=errorline then p:=firstcount+m else p:=firstcount+(errorline-n-3
);for q:=firstcount to p-1 do printchar(trickbuf[q mod errorline]);
if m+n>errorline then print(278){:599};end{:592};
if(curinput.indexfield<=6)then if(curinput.namefield>2)or(fileptr=0)then
goto 30;fileptr:=fileptr-1;end;30:curinput:=inputstack[inputptr];end;
{:591}{605:}procedure begintokenlist(p:halfword;t:quarterword);
begin begin if inputptr>maxinstack then begin maxinstack:=inputptr;
if inputptr=stacksize then overflow(651,stacksize);end;
inputstack[inputptr]:=curinput;inputptr:=inputptr+1;end;
curinput.startfield:=p;curinput.indexfield:=t;
curinput.limitfield:=paramptr;curinput.locfield:=p;end;
{:605}{606:}procedure endtokenlist;label 30;var p:halfword;
begin if curinput.indexfield>=10 then if curinput.indexfield<=11 then
begin flushtokenlist(curinput.startfield);goto 30;
end else deletemacref(curinput.startfield);
while paramptr>curinput.limitfield do begin paramptr:=paramptr-1;
p:=paramstack[paramptr];
if p<>0 then if mem[p].hh.rh=1 then begin recyclevalue(p);freenode(p,2);
end else flushtokenlist(p);end;30:begin inputptr:=inputptr-1;
curinput:=inputstack[inputptr];end;
begin if interrupt<>0 then pauseforinstructions;end;end;
{:606}{607:}{847:}{848:}procedure encapsulate(p:halfword);
begin curexp:=getnode(2);mem[curexp].hh.b0:=curtype;
mem[curexp].hh.b1:=19;newdep(curexp,p);end;
{:848}{850:}procedure install(r,q:halfword);var p:halfword;
begin if mem[q].hh.b0=17 then begin mem[r+1].int:=mem[q+1].int;
mem[r].hh.b0:=17;
end else if mem[q].hh.b0=20 then begin p:=singledependency(q);
if p=depfinal then begin mem[r].hh.b0:=17;mem[r+1].int:=0;freenode(p,2);
end else begin mem[r].hh.b0:=18;newdep(r,p);end;
end else begin mem[r].hh.b0:=mem[q].hh.b0;
newdep(r,copydeplist(mem[q+1].hh.rh));end;end;
{:850}procedure makeexpcopy(p:halfword);label 20;var q,r,t:halfword;
begin 20:curtype:=mem[p].hh.b0;
case curtype of 1,2,17:curexp:=mem[p+1].int;
3,5,7,11,9:curexp:=newringentry(p);4:begin curexp:=mem[p+1].int;
begin if strref[curexp]<127 then strref[curexp]:=strref[curexp]+1;end;
end;10:begin curexp:=mem[p+1].int;
mem[curexp].hh.lh:=mem[curexp].hh.lh+1;end;
6:curexp:=makepen(copypath(mem[p+1].int),false);
8:curexp:=copypath(mem[p+1].int);
12,13,14,15:{849:}begin if mem[p+1].int=0 then initbignode(p);
t:=getnode(2);mem[t].hh.b1:=19;mem[t].hh.b0:=curtype;initbignode(t);
q:=mem[p+1].int+bignodesize[curtype];
r:=mem[t+1].int+bignodesize[curtype];repeat q:=q-2;r:=r-2;install(r,q);
until q=mem[p+1].int;curexp:=t;end{:849};
18,19:encapsulate(copydeplist(mem[p+1].hh.rh));
16:begin begin if serialno=2147483584 then overflow(623,33554431);
mem[p].hh.b0:=20;serialno:=serialno+64;mem[p+1].int:=serialno;end;
goto 20;end;20:begin q:=singledependency(p);
if q=depfinal then begin curtype:=17;curexp:=0;freenode(q,2);
end else begin curtype:=18;encapsulate(q);end;end;
others:confusion(882)end;end;{:847}function curtok:halfword;
var p:halfword;savetype:smallnumber;saveexp:integer;
begin if cursym=0 then if curcmd=40 then begin savetype:=curtype;
saveexp:=curexp;makeexpcopy(curmod);p:=stashcurexp;mem[p].hh.rh:=0;
curtype:=savetype;curexp:=saveexp;end else begin p:=getnode(2);
mem[p+1].int:=curmod;mem[p].hh.b1:=20;
if curcmd=44 then mem[p].hh.b0:=17 else mem[p].hh.b0:=4;
end else begin begin p:=avail;
if p=0 then p:=getavail else begin avail:=mem[p].hh.rh;mem[p].hh.rh:=0;
{dynused:=dynused+1;}end;end;mem[p].hh.lh:=cursym;end;curtok:=p;end;
{:607}{608:}procedure backinput;var p:halfword;begin p:=curtok;
while(curinput.indexfield>6)and(curinput.locfield=0)do endtokenlist;
begintokenlist(p,10);end;{:608}{609:}procedure backerror;
begin OKtointerrupt:=false;backinput;OKtointerrupt:=true;error;end;
procedure inserror;begin OKtointerrupt:=false;backinput;
curinput.indexfield:=11;OKtointerrupt:=true;error;end;
{:609}{610:}procedure beginfilereading;
begin if inopen=6 then overflow(652,6);
if first=bufsize then overflow(257,bufsize);inopen:=inopen+1;
begin if inputptr>maxinstack then begin maxinstack:=inputptr;
if inputptr=stacksize then overflow(651,stacksize);end;
inputstack[inputptr]:=curinput;inputptr:=inputptr+1;end;
curinput.indexfield:=inopen;mpxname[curinput.indexfield]:=1;
curinput.startfield:=first;curinput.namefield:=0;end;
{:610}{611:}procedure endfilereading;
begin if inopen>curinput.indexfield then if(mpxname[inopen]=1)or(
curinput.namefield<=2)then confusion(653)else begin aclose(inputfile[
inopen]);
begin if strref[mpxname[inopen]]<127 then if strref[mpxname[inopen]]>1
then strref[mpxname[inopen]]:=strref[mpxname[inopen]]-1 else flushstring
(mpxname[inopen]);end;inopen:=inopen-1;end;first:=curinput.startfield;
if curinput.indexfield<>inopen then confusion(653);
if curinput.namefield>2 then begin aclose(inputfile[curinput.indexfield]
);begin if strref[curinput.namefield]<127 then if strref[curinput.
namefield]>1 then strref[curinput.namefield]:=strref[curinput.namefield]
-1 else flushstring(curinput.namefield);end;
begin if strref[inamestack[curinput.indexfield]]<127 then if strref[
inamestack[curinput.indexfield]]>1 then strref[inamestack[curinput.
indexfield]]:=strref[inamestack[curinput.indexfield]]-1 else flushstring
(inamestack[curinput.indexfield]);end;
begin if strref[iareastack[curinput.indexfield]]<127 then if strref[
iareastack[curinput.indexfield]]>1 then strref[iareastack[curinput.
indexfield]]:=strref[iareastack[curinput.indexfield]]-1 else flushstring
(iareastack[curinput.indexfield]);end;end;begin inputptr:=inputptr-1;
curinput:=inputstack[inputptr];end;inopen:=inopen-1;end;
{:611}{612:}function beginmpxreading:boolean;
begin if inopen<>curinput.indexfield+1 then beginmpxreading:=false else
begin if mpxname[inopen]<=1 then confusion(654);
if first=bufsize then overflow(257,bufsize);
begin if inputptr>maxinstack then begin maxinstack:=inputptr;
if inputptr=stacksize then overflow(651,stacksize);end;
inputstack[inputptr]:=curinput;inputptr:=inputptr+1;end;
curinput.indexfield:=inopen;curinput.startfield:=first;
curinput.namefield:=mpxname[inopen];
begin if strref[curinput.namefield]<127 then strref[curinput.namefield]
:=strref[curinput.namefield]+1;end;{645:}last:=first;
curinput.limitfield:=last;buffer[curinput.limitfield]:=37;
first:=curinput.limitfield+1;
curinput.locfield:=curinput.startfield{:645};beginmpxreading:=true;end;
end;{:612}{613:}procedure endmpxreading;
begin if inopen<>curinput.indexfield then confusion(654);
if curinput.locfield<curinput.limitfield then{615:}begin begin if
interaction=3 then;printnl(263);print(655);end;begin helpptr:=4;
helpline[3]:=656;helpline[2]:=657;helpline[1]:=658;helpline[0]:=659;end;
error;end{:615};first:=curinput.startfield;begin inputptr:=inputptr-1;
curinput:=inputstack[inputptr];end;end;
{:613}{616:}procedure clearforerrorprompt;
begin while(curinput.indexfield<=6)and(curinput.namefield=0)and(inputptr
>0)and(curinput.locfield=curinput.limitfield)do endfilereading;println;
breakin(termin,true);end;
{:616}{621:}function checkoutervalidity:boolean;var p:halfword;
begin if scannerstatus=0 then checkoutervalidity:=true else if
scannerstatus=7 then{622:}if cursym<>0 then checkoutervalidity:=true
else begin deletionsallowed:=false;begin if interaction=3 then;
printnl(263);print(665);end;printint(warninginfo);begin helpptr:=2;
helpline[1]:=666;helpline[0]:=667;end;cursym:=2368;inserror;
deletionsallowed:=true;checkoutervalidity:=false;
end{:622}else begin deletionsallowed:=false;
{623:}if cursym<>0 then begin p:=getavail;mem[p].hh.lh:=cursym;
begintokenlist(p,10);end{:623};
if scannerstatus>1 then{624:}begin runaway;
if cursym=0 then begin if interaction=3 then;printnl(263);print(668);
end else begin begin if interaction=3 then;printnl(263);print(669);end;
end;print(670);begin helpptr:=4;helpline[3]:=671;helpline[2]:=672;
helpline[1]:=673;helpline[0]:=674;end;
case scannerstatus of{625:}2:begin print(675);helpline[3]:=676;
cursym:=2363;end;3:begin print(677);helpline[3]:=678;
if warninginfo=0 then cursym:=2367 else begin cursym:=2359;
eqtb[2359].rh:=warninginfo;end;end;4,5:begin print(679);
if scannerstatus=5 then print(hash[warninginfo].rh)else
printvariablename(warninginfo);cursym:=2365;end;6:begin print(680);
print(hash[warninginfo].rh);print(681);helpline[3]:=682;cursym:=2364;
end;{:625}end;inserror;end{:624}else begin begin if interaction=3 then;
printnl(263);print(660);end;printint(warninginfo);begin helpptr:=3;
helpline[2]:=661;helpline[1]:=662;helpline[0]:=663;end;
if cursym=0 then helpline[2]:=664;cursym:=2366;inserror;end;
deletionsallowed:=true;checkoutervalidity:=false;end;end;
{:621}{627:}procedure firmuptheline;forward;
{:627}{628:}procedure getnext;label 20,10,50,40,25,85,86,87,30;
var k:0..bufsize;c:ASCIIcode;class:ASCIIcode;n,f:integer;
begin 20:cursym:=0;
if(curinput.indexfield<=6)then{630:}begin 25:c:=buffer[curinput.locfield
];curinput.locfield:=curinput.locfield+1;class:=charclass[c];
case class of 0:goto 85;
1:begin class:=charclass[buffer[curinput.locfield]];
if class>1 then goto 25 else if class<1 then begin n:=0;goto 86;end;end;
2:goto 25;
3:begin if scannerstatus=7 then if curinput.locfield<curinput.limitfield
then goto 25;
{641:}if curinput.namefield>2 then{643:}begin linestack[curinput.
indexfield]:=linestack[curinput.indexfield]+1;
first:=curinput.startfield;
if not forceeof then begin if inputln(inputfile[curinput.indexfield],
true)then firmuptheline else forceeof:=true;end;
if forceeof then begin forceeof:=false;
curinput.locfield:=curinput.locfield-1;
if(mpxname[curinput.indexfield]>1)then{644:}begin mpxname[curinput.
indexfield]:=0;begin if interaction=3 then;printnl(263);print(701);end;
begin helpptr:=4;helpline[3]:=702;helpline[2]:=657;helpline[1]:=703;
helpline[0]:=704;end;deletionsallowed:=false;error;
deletionsallowed:=true;cursym:=2369;goto 50;
end{:644}else begin printchar(41);openparens:=openparens-1;
break(termout);endfilereading;
if checkoutervalidity then goto 20 else goto 20;end end;
buffer[curinput.limitfield]:=37;first:=curinput.limitfield+1;
curinput.locfield:=curinput.startfield;
end{:643}else begin if inputptr>0 then begin endfilereading;goto 20;end;
if selector<9 then openlogfile;
if interaction>1 then begin if curinput.limitfield=curinput.startfield
then printnl(699);println;first:=curinput.startfield;begin;print(42);
terminput;end;curinput.limitfield:=last;buffer[curinput.limitfield]:=37;
first:=curinput.limitfield+1;curinput.locfield:=curinput.startfield;
end else fatalerror(700);end{:641};
begin if interrupt<>0 then pauseforinstructions;end;goto 25;end;
4:if scannerstatus=7 then goto 25 else{632:}begin if buffer[curinput.
locfield]=34 then curmod:=287 else begin k:=curinput.locfield;
buffer[curinput.limitfield+1]:=34;
repeat curinput.locfield:=curinput.locfield+1;
until buffer[curinput.locfield]=34;
if curinput.locfield>curinput.limitfield then{633:}begin curinput.
locfield:=curinput.limitfield;begin if interaction=3 then;printnl(263);
print(690);end;begin helpptr:=3;helpline[2]:=691;helpline[1]:=692;
helpline[0]:=693;end;deletionsallowed:=false;error;
deletionsallowed:=true;goto 20;end{:633};
if curinput.locfield=k+1 then curmod:=buffer[k]else begin begin if
poolptr+curinput.locfield-k>maxpoolptr then if poolptr+curinput.locfield
-k>poolsize then docompaction(curinput.locfield-k)else maxpoolptr:=
poolptr+curinput.locfield-k;end;
repeat begin strpool[poolptr]:=buffer[k];poolptr:=poolptr+1;end;k:=k+1;
until k=curinput.locfield;curmod:=makestring;end;end;
curinput.locfield:=curinput.locfield+1;curcmd:=41;goto 10;end{:632};
5,6,7,8:begin k:=curinput.locfield-1;goto 40;end;
20:if scannerstatus=7 then goto 25 else{631:}begin begin if interaction=
3 then;printnl(263);print(687);end;begin helpptr:=2;helpline[1]:=688;
helpline[0]:=689;end;deletionsallowed:=false;error;
deletionsallowed:=true;goto 20;end{:631};others:end;
k:=curinput.locfield-1;
while charclass[buffer[curinput.locfield]]=class do curinput.locfield:=
curinput.locfield+1;goto 40;85:{634:}n:=c-48;
while charclass[buffer[curinput.locfield]]=0 do begin if n<32768 then n
:=10*n+buffer[curinput.locfield]-48;
curinput.locfield:=curinput.locfield+1;end;
if buffer[curinput.locfield]=46 then if charclass[buffer[curinput.
locfield+1]]=0 then goto 30;f:=0;goto 87;
30:curinput.locfield:=curinput.locfield+1{:634};86:{635:}k:=0;
repeat if k<17 then begin dig[k]:=buffer[curinput.locfield]-48;k:=k+1;
end;curinput.locfield:=curinput.locfield+1;
until charclass[buffer[curinput.locfield]]<>0;f:=rounddecimals(k);
if f=65536 then begin n:=n+1;f:=0;end{:635};
87:{636:}if n<32768 then{637:}begin curmod:=n*65536+f;
if curmod>=268435456 then if(internal[30]>0)and(scannerstatus<>7)then
begin begin if interaction=3 then;printnl(263);print(697);end;
printscaled(curmod);printchar(41);begin helpptr:=3;helpline[2]:=698;
helpline[1]:=629;helpline[0]:=630;end;error;end;
end{:637}else if scannerstatus<>7 then begin begin if interaction=3 then
;printnl(263);print(694);end;begin helpptr:=2;helpline[1]:=695;
helpline[0]:=696;end;deletionsallowed:=false;error;
deletionsallowed:=true;curmod:=2147483647;end;curcmd:=44;goto 10{:636};
40:cursym:=idlookup(k,curinput.locfield-k);
end{:630}else{638:}if curinput.locfield>=himemmin then begin cursym:=mem
[curinput.locfield].hh.lh;
curinput.locfield:=mem[curinput.locfield].hh.rh;
if cursym>=2372 then if cursym>=2522 then{639:}begin if cursym>=2672
then cursym:=cursym-150;
begintokenlist(paramstack[curinput.limitfield+cursym-(2522)],9);goto 20;
end{:639}else begin curcmd:=40;
curmod:=paramstack[curinput.limitfield+cursym-(2372)];cursym:=0;goto 10;
end;
end else if curinput.locfield>0 then{640:}begin if mem[curinput.locfield
].hh.b1=20 then begin curmod:=mem[curinput.locfield+1].int;
if mem[curinput.locfield].hh.b0=17 then curcmd:=44 else begin curcmd:=41
;begin if strref[curmod]<127 then strref[curmod]:=strref[curmod]+1;end;
end;end else begin curmod:=curinput.locfield;curcmd:=40;end;
curinput.locfield:=mem[curinput.locfield].hh.rh;goto 10;
end{:640}else begin endtokenlist;goto 20;end{:638};
50:{629:}curcmd:=eqtb[cursym].lh;curmod:=eqtb[cursym].rh;
if curcmd>=85 then if checkoutervalidity then curcmd:=curcmd-85 else
goto 20{:629};10:end;{:628}{646:}procedure firmuptheline;
var k:0..bufsize;begin curinput.limitfield:=last;
if internal[24]>0 then if interaction>1 then begin;println;
if curinput.startfield<curinput.limitfield then for k:=curinput.
startfield to curinput.limitfield-1 do print(buffer[k]);
first:=curinput.limitfield;begin;print(705);terminput;end;
if last>first then begin for k:=first to last-1 do buffer[k+curinput.
startfield-first]:=buffer[k];
curinput.limitfield:=curinput.startfield+last-first;end;end;end;
{:646}{650:}procedure startmpxinput;forward;procedure tnext;label 65,50;
var oldstatus:0..6;oldinfo:integer;
begin while curcmd<=3 do begin if curcmd=3 then if not(curinput.
indexfield<=6)or(mpxname[curinput.indexfield]=1)then{654:}begin begin if
interaction=3 then;printnl(263);print(715);end;begin helpptr:=2;
helpline[1]:=716;helpline[0]:=717;end;error;
end{:654}else begin endmpxreading;goto 65;
end else if curcmd=1 then if(curinput.indexfield>6)or(curinput.namefield
<=2)then{653:}begin begin if interaction=3 then;printnl(263);print(711);
end;begin helpptr:=3;helpline[2]:=712;helpline[1]:=713;helpline[0]:=714;
end;error;
end{:653}else if(mpxname[curinput.indexfield]>1)then{652:}begin begin if
interaction=3 then;printnl(263);print(708);end;begin helpptr:=4;
helpline[3]:=656;helpline[2]:=657;helpline[1]:=709;helpline[0]:=710;end;
error;
end{:652}else if(curmod<>1)and(mpxname[curinput.indexfield]<>0)then
begin if not beginmpxreading then startmpxinput;
end else goto 65 else{655:}begin begin if interaction=3 then;
printnl(263);print(718);end;begin helpptr:=1;helpline[0]:=719;end;error;
end{:655};goto 50;65:{651:}oldstatus:=scannerstatus;
oldinfo:=warninginfo;scannerstatus:=7;
warninginfo:=linestack[curinput.indexfield];repeat getnext;
until curcmd=2;scannerstatus:=oldstatus;warninginfo:=oldinfo{:651};
50:getnext;end;end;{:650}{658:}function scantoks(terminator:commandcode;
substlist,tailend:halfword;suffixcount:smallnumber):halfword;
label 30,40;var p:halfword;q:halfword;balance:integer;begin p:=29998;
balance:=1;mem[29998].hh.rh:=0;while true do begin begin getnext;
if curcmd<=3 then tnext;end;
if cursym>0 then begin{659:}begin q:=substlist;
while q<>0 do begin if mem[q].hh.lh=cursym then begin cursym:=mem[q+1].
int;curcmd:=10;goto 40;end;q:=mem[q].hh.rh;end;40:end{:659};
if curcmd=terminator then{660:}if curmod>0 then balance:=balance+1 else
begin balance:=balance-1;if balance=0 then goto 30;
end{:660}else if curcmd=63 then{663:}begin if curmod=0 then begin
getnext;if curcmd<=3 then tnext;
end else if curmod<=suffixcount then cursym:=2521+curmod;end{:663};end;
mem[p].hh.rh:=curtok;p:=mem[p].hh.rh;end;30:mem[p].hh.rh:=tailend;
flushnodelist(substlist);scantoks:=mem[29998].hh.rh;end;
{:658}{664:}procedure getsymbol;label 20;begin 20:begin getnext;
if curcmd<=3 then tnext;end;
if(cursym=0)or(cursym>2357)then begin begin if interaction=3 then;
printnl(263);print(731);end;begin helpptr:=3;helpline[2]:=732;
helpline[1]:=733;helpline[0]:=734;end;
if cursym>0 then helpline[2]:=735 else if curcmd=41 then begin if strref
[curmod]<127 then if strref[curmod]>1 then strref[curmod]:=strref[curmod
]-1 else flushstring(curmod);end;cursym:=2357;inserror;goto 20;end;end;
{:664}{665:}procedure getclearsymbol;begin getsymbol;
clearsymbol(cursym,false);end;{:665}{666:}procedure checkequals;
begin if curcmd<>53 then if curcmd<>76 then begin missingerr(61);
begin helpptr:=5;helpline[4]:=736;helpline[3]:=737;helpline[2]:=738;
helpline[1]:=739;helpline[0]:=740;end;backerror;end;end;
{:666}{667:}procedure makeopdef;var m:commandcode;p,q,r:halfword;
begin m:=curmod;getsymbol;q:=getnode(2);mem[q].hh.lh:=cursym;
mem[q+1].int:=2372;getclearsymbol;warninginfo:=cursym;getsymbol;
p:=getnode(2);mem[p].hh.lh:=cursym;mem[p+1].int:=2373;mem[p].hh.rh:=q;
begin getnext;if curcmd<=3 then tnext;end;checkequals;scannerstatus:=5;
q:=getavail;mem[q].hh.lh:=0;r:=getavail;mem[q].hh.rh:=r;mem[r].hh.lh:=0;
mem[r].hh.rh:=scantoks(18,p,0,0);scannerstatus:=0;
eqtb[warninginfo].lh:=m;eqtb[warninginfo].rh:=q;getxnext;end;
{:667}{670:}{1054:}procedure checkdelimiter(ldelim,rdelim:halfword);
label 10;begin if curcmd=64 then if curmod=ldelim then goto 10;
if cursym<>rdelim then begin missingerr(hash[rdelim].rh);
begin helpptr:=2;helpline[1]:=1001;helpline[0]:=1002;end;backerror;
end else begin begin if interaction=3 then;printnl(263);print(1003);end;
print(hash[rdelim].rh);print(1004);begin helpptr:=3;helpline[2]:=1005;
helpline[1]:=1006;helpline[0]:=1007;end;error;end;10:end;
{:1054}{1033:}function scandeclaredvariable:halfword;label 30;
var x:halfword;h,t:halfword;l:halfword;begin getsymbol;x:=cursym;
if curcmd<>43 then clearsymbol(x,false);h:=getavail;mem[h].hh.lh:=x;
t:=h;while true do begin getxnext;if cursym=0 then goto 30;
if curcmd<>43 then if curcmd<>42 then if curcmd=65 then{1034:}begin l:=
cursym;getxnext;if curcmd<>66 then begin backinput;cursym:=l;curcmd:=65;
goto 30;end else cursym:=0;end{:1034}else goto 30;
mem[t].hh.rh:=getavail;t:=mem[t].hh.rh;mem[t].hh.lh:=cursym;end;
30:if eqtb[x].lh<>43 then clearsymbol(x,false);
if eqtb[x].rh=0 then newroot(x);scandeclaredvariable:=h;end;
{:1033}procedure scandef;var m:1..2;n:0..3;k:0..150;c:0..7;r:halfword;
q:halfword;p:halfword;base:halfword;ldelim,rdelim:halfword;
begin m:=curmod;c:=0;mem[29998].hh.rh:=0;q:=getavail;mem[q].hh.lh:=0;
r:=0;{673:}if m=1 then begin getclearsymbol;warninginfo:=cursym;
begin getnext;if curcmd<=3 then tnext;end;scannerstatus:=5;n:=0;
eqtb[warninginfo].lh:=13;eqtb[warninginfo].rh:=q;
end else begin p:=scandeclaredvariable;
flushvariable(eqtb[mem[p].hh.lh].rh,mem[p].hh.rh,true);
warninginfo:=findvariable(p);flushlist(p);
if warninginfo=0 then{674:}begin begin if interaction=3 then;
printnl(263);print(747);end;begin helpptr:=2;helpline[1]:=748;
helpline[0]:=749;end;error;warninginfo:=22;end{:674};scannerstatus:=4;
n:=2;if curcmd=63 then if curmod=3 then begin n:=3;begin getnext;
if curcmd<=3 then tnext;end;end;mem[warninginfo].hh.b0:=21+n;
mem[warninginfo+1].int:=q;end{:673};k:=n;
if curcmd=33 then{676:}repeat ldelim:=cursym;rdelim:=curmod;
begin getnext;if curcmd<=3 then tnext;end;
if(curcmd=58)and(curmod>=2372)then base:=curmod else begin begin if
interaction=3 then;printnl(263);print(750);end;begin helpptr:=1;
helpline[0]:=751;end;backerror;base:=2372;end;
{677:}repeat mem[q].hh.rh:=getavail;q:=mem[q].hh.rh;
mem[q].hh.lh:=base+k;getsymbol;p:=getnode(2);mem[p+1].int:=base+k;
mem[p].hh.lh:=cursym;if k=150 then overflow(752,150);k:=k+1;
mem[p].hh.rh:=r;r:=p;begin getnext;if curcmd<=3 then tnext;end;
until curcmd<>81{:677};checkdelimiter(ldelim,rdelim);begin getnext;
if curcmd<=3 then tnext;end;until curcmd<>33{:676};
if curcmd=58 then{678:}begin p:=getnode(2);
if curmod<2372 then begin c:=curmod;mem[p+1].int:=2372+k;
end else begin mem[p+1].int:=curmod+k;
if curmod=2372 then c:=4 else if curmod=2522 then c:=6 else c:=7;end;
if k=150 then overflow(752,150);k:=k+1;getsymbol;mem[p].hh.lh:=cursym;
mem[p].hh.rh:=r;r:=p;begin getnext;if curcmd<=3 then tnext;end;
if c=4 then if curcmd=70 then begin c:=5;p:=getnode(2);
if k=150 then overflow(752,150);mem[p+1].int:=2372+k;getsymbol;
mem[p].hh.lh:=cursym;mem[p].hh.rh:=r;r:=p;begin getnext;
if curcmd<=3 then tnext;end;end;end{:678};checkequals;p:=getavail;
mem[p].hh.lh:=c;mem[q].hh.rh:=p;
{671:}if m=1 then mem[p].hh.rh:=scantoks(18,r,0,n)else begin q:=getavail
;mem[q].hh.lh:=bgloc;mem[p].hh.rh:=q;p:=getavail;mem[p].hh.lh:=egloc;
mem[q].hh.rh:=scantoks(18,r,p,n);end;
if warninginfo=22 then flushtokenlist(mem[23].int){:671};
scannerstatus:=0;getxnext;end;{:670}{679:}procedure scanprimary;forward;
procedure scansecondary;forward;procedure scantertiary;forward;
procedure scanexpression;forward;procedure scansuffix;forward;
{693:}{695:}procedure printmacroname(a,n:halfword);var p,q:halfword;
begin if n<>0 then print(hash[n].rh)else begin p:=mem[a].hh.lh;
if p=0 then print(hash[mem[mem[mem[a].hh.rh].hh.lh].hh.lh].rh)else begin
q:=p;while mem[q].hh.rh<>0 do q:=mem[q].hh.rh;
mem[q].hh.rh:=mem[mem[a].hh.rh].hh.lh;showtokenlist(p,0,1000,0);
mem[q].hh.rh:=0;end;end;end;{:695}{696:}procedure printarg(q:halfword;
n:integer;b:halfword);
begin if mem[q].hh.rh=1 then printnl(526)else if(b<2672)and(b<>7)then
printnl(527)else printnl(528);printint(n);print(768);
if mem[q].hh.rh=1 then printexp(q,1)else showtokenlist(q,0,1000,0);end;
{:696}{703:}procedure scantextarg(ldelim,rdelim:halfword);label 30;
var balance:integer;p:halfword;begin warninginfo:=ldelim;
scannerstatus:=3;p:=29998;balance:=1;mem[29998].hh.rh:=0;
while true do begin begin getnext;if curcmd<=3 then tnext;end;
if ldelim=0 then{705:}begin if curcmd>81 then begin if balance=1 then
goto 30 else if curcmd=83 then balance:=balance-1;
end else if curcmd=34 then balance:=balance+1;
end{:705}else{704:}begin if curcmd=64 then begin if curmod=ldelim then
begin balance:=balance-1;if balance=0 then goto 30;end;
end else if curcmd=33 then if curmod=rdelim then balance:=balance+1;
end{:704};mem[p].hh.rh:=curtok;p:=mem[p].hh.rh;end;
30:curexp:=mem[29998].hh.rh;curtype:=21;scannerstatus:=0;end;
{:703}procedure macrocall(defref,arglist,macroname:halfword);label 40;
var r:halfword;p,q:halfword;n:integer;ldelim,rdelim:halfword;
tail:halfword;begin r:=mem[defref].hh.rh;
mem[defref].hh.lh:=mem[defref].hh.lh+1;
if arglist=0 then n:=0 else{697:}begin n:=1;tail:=arglist;
while mem[tail].hh.rh<>0 do begin n:=n+1;tail:=mem[tail].hh.rh;end;
end{:697};if internal[8]>0 then{694:}begin begindiagnostic;println;
printmacroname(arglist,macroname);if n=3 then print(730);
showmacro(defref,0,100000);if arglist<>0 then begin n:=0;p:=arglist;
repeat q:=mem[p].hh.lh;printarg(q,n,0);n:=n+1;p:=mem[p].hh.rh;until p=0;
end;enddiagnostic(false);end{:694};{698:}curcmd:=82;
while mem[r].hh.lh>=2372 do begin{699:}if curcmd<>81 then begin getxnext
;if curcmd<>33 then begin begin if interaction=3 then;printnl(263);
print(774);end;printmacroname(arglist,macroname);begin helpptr:=3;
helpline[2]:=775;helpline[1]:=776;helpline[0]:=777;end;
if mem[r].hh.lh>=2522 then begin curexp:=0;curtype:=21;
end else begin curexp:=0;curtype:=17;end;backerror;curcmd:=64;goto 40;
end;ldelim:=cursym;rdelim:=curmod;end;
{702:}if mem[r].hh.lh>=2672 then scantextarg(ldelim,rdelim)else begin
getxnext;if mem[r].hh.lh>=2522 then scansuffix else scanexpression;
end{:702};
if curcmd<>81 then{700:}if(curcmd<>64)or(curmod<>ldelim)then if mem[mem[
r].hh.rh].hh.lh>=2372 then begin missingerr(44);begin helpptr:=3;
helpline[2]:=778;helpline[1]:=779;helpline[0]:=773;end;backerror;
curcmd:=81;end else begin missingerr(hash[rdelim].rh);begin helpptr:=2;
helpline[1]:=780;helpline[0]:=773;end;backerror;end{:700};
40:{701:}begin p:=getavail;
if curtype=21 then mem[p].hh.lh:=curexp else mem[p].hh.lh:=stashcurexp;
if internal[8]>0 then begin begindiagnostic;
printarg(mem[p].hh.lh,n,mem[r].hh.lh);enddiagnostic(false);end;
if arglist=0 then arglist:=p else mem[tail].hh.rh:=p;tail:=p;n:=n+1;
end{:701}{:699};r:=mem[r].hh.rh;end;
if curcmd=81 then begin begin if interaction=3 then;printnl(263);
print(769);end;printmacroname(arglist,macroname);printchar(59);
printnl(770);print(hash[rdelim].rh);print(302);begin helpptr:=3;
helpline[2]:=771;helpline[1]:=772;helpline[0]:=773;end;error;end;
if mem[r].hh.lh<>0 then{706:}begin if mem[r].hh.lh<7 then begin getxnext
;if mem[r].hh.lh<>6 then if(curcmd=53)or(curcmd=76)then getxnext;end;
case mem[r].hh.lh of 1:scanprimary;2:scansecondary;3:scantertiary;
4:scanexpression;5:{707:}begin scanexpression;p:=getavail;
mem[p].hh.lh:=stashcurexp;if internal[8]>0 then begin begindiagnostic;
printarg(mem[p].hh.lh,n,0);enddiagnostic(false);end;
if arglist=0 then arglist:=p else mem[tail].hh.rh:=p;tail:=p;n:=n+1;
if curcmd<>70 then begin missingerr(503);print(781);
printmacroname(arglist,macroname);begin helpptr:=1;helpline[0]:=782;end;
backerror;end;getxnext;scanprimary;end{:707};
6:{708:}begin if curcmd<>33 then ldelim:=0 else begin ldelim:=cursym;
rdelim:=curmod;getxnext;end;scansuffix;
if ldelim<>0 then begin if(curcmd<>64)or(curmod<>ldelim)then begin
missingerr(hash[rdelim].rh);begin helpptr:=2;helpline[1]:=780;
helpline[0]:=773;end;backerror;end;getxnext;end;end{:708};
7:scantextarg(0,0);end;backinput;{701:}begin p:=getavail;
if curtype=21 then mem[p].hh.lh:=curexp else mem[p].hh.lh:=stashcurexp;
if internal[8]>0 then begin begindiagnostic;
printarg(mem[p].hh.lh,n,mem[r].hh.lh);enddiagnostic(false);end;
if arglist=0 then arglist:=p else mem[tail].hh.rh:=p;tail:=p;n:=n+1;
end{:701};end{:706};r:=mem[r].hh.rh{:698};
{709:}while(curinput.indexfield>6)and(curinput.locfield=0)do
endtokenlist;
if paramptr+n>maxparamstack then begin maxparamstack:=paramptr+n;
if maxparamstack>150 then overflow(752,150);end;
begintokenlist(defref,12);curinput.namefield:=macroname;
curinput.locfield:=r;if n>0 then begin p:=arglist;
repeat paramstack[paramptr]:=mem[p].hh.lh;paramptr:=paramptr+1;
p:=mem[p].hh.rh;until p=0;flushlist(arglist);end{:709};end;
{:693}procedure getboolean;forward;procedure passtext;forward;
procedure conditional;forward;procedure startinput;forward;
procedure beginiteration;forward;procedure resumeiteration;forward;
procedure stopiteration;forward;{:679}{680:}procedure expand;
var p:halfword;k:integer;j:poolpointer;
begin if internal[6]>65536 then if curcmd<>13 then showcmdmod(curcmd,
curmod);case curcmd of 4:conditional;
5:{724:}if curmod>iflimit then if iflimit=1 then begin missingerr(58);
backinput;cursym:=2362;inserror;
end else begin begin if interaction=3 then;printnl(263);print(789);end;
printcmdmod(5,curmod);begin helpptr:=1;helpline[0]:=790;end;error;
end else begin while curmod<>2 do passtext;{718:}begin p:=condptr;
ifline:=mem[p+1].int;curif:=mem[p].hh.b1;iflimit:=mem[p].hh.b0;
condptr:=mem[p].hh.rh;freenode(p,2);end{:718};end{:724};
6:{684:}if curmod>0 then forceeof:=true else startinput{:684};
7:if curmod=0 then{681:}begin begin if interaction=3 then;printnl(263);
print(753);end;begin helpptr:=2;helpline[1]:=754;helpline[0]:=755;end;
error;end{:681}else beginiteration;
8:{685:}begin while(curinput.indexfield>6)and(curinput.locfield=0)do
endtokenlist;if loopptr=0 then begin begin if interaction=3 then;
printnl(263);print(757);end;begin helpptr:=2;helpline[1]:=758;
helpline[0]:=759;end;error;end else resumeiteration;end{:685};
9:{686:}begin getboolean;
if internal[6]>65536 then showcmdmod(35,curexp);
if curexp=30 then if loopptr=0 then begin begin if interaction=3 then;
printnl(263);print(760);end;begin helpptr:=1;helpline[0]:=761;end;
if curcmd=82 then error else backerror;end else{687:}begin p:=0;
repeat if(curinput.indexfield<=6)then endfilereading else begin if
curinput.indexfield<=8 then p:=curinput.startfield;endtokenlist;end;
until p<>0;if p<>mem[loopptr].hh.lh then fatalerror(764);stopiteration;
end{:687}else if curcmd<>82 then begin missingerr(59);begin helpptr:=2;
helpline[1]:=762;helpline[0]:=763;end;backerror;end;end{:686};10:;
12:{688:}begin begin getnext;if curcmd<=3 then tnext;end;p:=curtok;
begin getnext;if curcmd<=3 then tnext;end;
if curcmd<14 then expand else backinput;begintokenlist(p,10);end{:688};
11:{689:}begin getxnext;scanprimary;
if curtype<>4 then begin disperr(0,765);begin helpptr:=2;
helpline[1]:=766;helpline[0]:=767;end;putgetflusherror(0);
end else begin backinput;
if(strstart[nextstr[curexp]]-strstart[curexp])>0 then{690:}begin
beginfilereading;curinput.namefield:=2;
k:=first+(strstart[nextstr[curexp]]-strstart[curexp]);
if k>=maxbufstack then begin if k>=bufsize then begin maxbufstack:=
bufsize;overflow(257,bufsize);end;maxbufstack:=k+1;end;
j:=strstart[curexp];curinput.limitfield:=k;
while first<curinput.limitfield do begin buffer[first]:=strpool[j];
j:=j+1;first:=first+1;end;buffer[curinput.limitfield]:=37;
first:=curinput.limitfield+1;curinput.locfield:=curinput.startfield;
flushcurexp(0);end{:690};end;end{:689};13:macrocall(curmod,0,cursym);
end;end;{:680}{691:}procedure getxnext;var saveexp:halfword;
begin begin getnext;if curcmd<=3 then tnext;end;
if curcmd<14 then begin saveexp:=stashcurexp;
repeat if curcmd=13 then macrocall(curmod,0,cursym)else expand;
begin getnext;if curcmd<=3 then tnext;end;until curcmd>=14;
unstashcurexp(saveexp);end;end;
{:691}{710:}procedure stackargument(p:halfword);
begin if paramptr=maxparamstack then begin maxparamstack:=maxparamstack
+1;if maxparamstack>150 then overflow(752,150);end;
paramstack[paramptr]:=p;paramptr:=paramptr+1;end;
{:710}{715:}procedure passtext;label 30;var l:integer;
begin scannerstatus:=1;l:=0;warninginfo:=trueline;
while true do begin begin getnext;if curcmd<=3 then tnext;end;
if curcmd<=5 then if curcmd<5 then l:=l+1 else begin if l=0 then goto 30
;if curmod=2 then l:=l-1;
end else{716:}if curcmd=41 then begin if strref[curmod]<127 then if
strref[curmod]>1 then strref[curmod]:=strref[curmod]-1 else flushstring(
curmod);end{:716};end;30:scannerstatus:=0;end;
{:715}{719:}procedure changeiflimit(l:smallnumber;p:halfword);label 10;
var q:halfword;begin if p=condptr then iflimit:=l else begin q:=condptr;
while true do begin if q=0 then confusion(783);
if mem[q].hh.rh=p then begin mem[q].hh.b0:=l;goto 10;end;
q:=mem[q].hh.rh;end;end;10:end;{:719}{720:}procedure checkcolon;
begin if curcmd<>80 then begin missingerr(58);begin helpptr:=2;
helpline[1]:=786;helpline[0]:=763;end;backerror;end;end;
{:720}{721:}procedure conditional;label 10,30,21,40;
var savecondptr:halfword;newiflimit:2..4;p:halfword;
begin{717:}begin p:=getnode(2);mem[p].hh.rh:=condptr;
mem[p].hh.b0:=iflimit;mem[p].hh.b1:=curif;mem[p+1].int:=ifline;
condptr:=p;iflimit:=1;ifline:=trueline;curif:=1;end{:717};
savecondptr:=condptr;21:getboolean;newiflimit:=4;
if internal[6]>65536 then{723:}begin begindiagnostic;
if curexp=30 then print(787)else print(788);enddiagnostic(false);
end{:723};40:checkcolon;
if curexp=30 then begin changeiflimit(newiflimit,savecondptr);goto 10;
end;{722:}while true do begin passtext;
if condptr=savecondptr then goto 30 else if curmod=2 then{718:}begin p:=
condptr;ifline:=mem[p+1].int;curif:=mem[p].hh.b1;iflimit:=mem[p].hh.b0;
condptr:=mem[p].hh.rh;freenode(p,2);end{:718};end{:722};
30:curif:=curmod;ifline:=trueline;
if curmod=2 then{718:}begin p:=condptr;ifline:=mem[p+1].int;
curif:=mem[p].hh.b1;iflimit:=mem[p].hh.b0;condptr:=mem[p].hh.rh;
freenode(p,2);
end{:718}else if curmod=4 then goto 21 else begin curexp:=30;
newiflimit:=2;getxnext;goto 40;end;10:end;
{:721}{727:}procedure badfor(s:strnumber);begin disperr(0,791);print(s);
print(309);begin helpptr:=4;helpline[3]:=792;helpline[2]:=793;
helpline[1]:=794;helpline[0]:=311;end;putgetflusherror(0);end;
{:727}{728:}procedure beginiteration;label 22,30;var m:halfword;
n:halfword;s:halfword;p:halfword;q:halfword;pp:halfword;begin m:=curmod;
n:=cursym;s:=getnode(2);if m=1 then begin mem[s+1].hh.lh:=1;p:=0;
getxnext;end else begin getsymbol;p:=getnode(2);mem[p].hh.lh:=cursym;
mem[p+1].int:=m;getxnext;if curcmd=74 then{741:}begin getxnext;
scanexpression;{742:}if curtype<>10 then begin disperr(0,807);
begin helpptr:=1;helpline[0]:=808;end;putgetflusherror(getnode(8));
initedges(curexp);curtype:=10;end{:742};mem[s+1].hh.lh:=curexp;
curtype:=1;q:=mem[curexp+7].hh.rh;
if q<>0 then if(mem[q].hh.b0>=4)then if skip1component(q)=0 then q:=mem[
q].hh.rh;mem[s+1].hh.rh:=q;
end{:741}else begin{729:}if(curcmd<>53)and(curcmd<>76)then begin
missingerr(61);begin helpptr:=3;helpline[2]:=795;helpline[1]:=738;
helpline[0]:=796;end;backerror;end{:729};{739:}mem[s+1].hh.lh:=0;q:=s+1;
mem[q].hh.rh:=0;repeat getxnext;
if m<>2372 then scansuffix else begin if curcmd>=80 then if curcmd<=81
then goto 22;scanexpression;
if curcmd=72 then if q=s+1 then{740:}begin if curtype<>17 then badfor(
802);pp:=getnode(4);mem[pp+1].int:=curexp;getxnext;scanexpression;
if curtype<>17 then badfor(803);mem[pp+2].int:=curexp;
if curcmd<>73 then begin missingerr(516);begin helpptr:=2;
helpline[1]:=804;helpline[0]:=805;end;backerror;end;getxnext;
scanexpression;if curtype<>17 then badfor(806);mem[pp+3].int:=curexp;
mem[s+1].hh.rh:=pp;mem[s+1].hh.lh:=2;goto 30;end{:740};
curexp:=stashcurexp;end;mem[q].hh.rh:=getavail;q:=mem[q].hh.rh;
mem[q].hh.lh:=curexp;curtype:=1;22:until curcmd<>81;30:{:739};end;end;
{730:}if curcmd<>80 then begin missingerr(58);begin helpptr:=3;
helpline[2]:=797;helpline[1]:=798;helpline[0]:=799;end;backerror;
end{:730};{732:}q:=getavail;mem[q].hh.lh:=2358;scannerstatus:=6;
warninginfo:=n;mem[s].hh.lh:=scantoks(7,p,q,0);scannerstatus:=0;
mem[s].hh.rh:=loopptr;loopptr:=s{:732};resumeiteration;end;
{:728}{734:}procedure resumeiteration;label 45,10;var p,q:halfword;
begin p:=mem[loopptr+1].hh.lh;if p=2 then begin p:=mem[loopptr+1].hh.rh;
curexp:=mem[p+1].int;
if{735:}((mem[p+2].int>0)and(curexp>mem[p+3].int))or((mem[p+2].int<0)and
(curexp<mem[p+3].int)){:735}then goto 45;curtype:=17;q:=stashcurexp;
mem[p+1].int:=curexp+mem[p+2].int;
end else if p=0 then begin p:=mem[loopptr+1].hh.rh;if p=0 then goto 45;
mem[loopptr+1].hh.rh:=mem[p].hh.rh;q:=mem[p].hh.lh;
begin mem[p].hh.rh:=avail;avail:=p;{dynused:=dynused-1;}end;
end else if p=1 then begin begintokenlist(mem[loopptr].hh.lh,7);goto 10;
end else{737:}begin q:=mem[loopptr+1].hh.rh;if q=0 then goto 45;
if not(mem[q].hh.b0>=4)then q:=mem[q].hh.rh else if not(mem[q].hh.b0>=6)
then q:=skip1component(q)else goto 45;
curexp:=copyobjects(mem[loopptr+1].hh.rh,q);initbbox(curexp);
curtype:=10;mem[loopptr+1].hh.rh:=q;q:=stashcurexp;end{:737};
begintokenlist(mem[loopptr].hh.lh,8);stackargument(q);
if internal[6]>65536 then{736:}begin begindiagnostic;printnl(801);
if(q<>0)and(mem[q].hh.rh=1)then printexp(q,1)else showtokenlist(q,0,50,0
);printchar(125);enddiagnostic(false);end{:736};goto 10;
45:stopiteration;10:end;{:734}{738:}procedure stopiteration;
var p,q:halfword;begin p:=mem[loopptr+1].hh.lh;
if p=2 then freenode(mem[loopptr+1].hh.rh,4)else if p=0 then begin q:=
mem[loopptr+1].hh.rh;while q<>0 do begin p:=mem[q].hh.lh;
if p<>0 then if mem[p].hh.rh=1 then begin recyclevalue(p);freenode(p,2);
end else flushtokenlist(p);p:=q;q:=mem[q].hh.rh;
begin mem[p].hh.rh:=avail;avail:=p;{dynused:=dynused-1;}end;end;
end else if p>2 then if mem[p].hh.lh=0 then tossedges(p)else mem[p].hh.
lh:=mem[p].hh.lh-1;p:=loopptr;loopptr:=mem[p].hh.rh;
flushtokenlist(mem[p].hh.lh);freenode(p,2);end;
{:738}{756:}procedure packbufferedname(n:smallnumber;a,b:integer);
var k:integer;c:ASCIIcode;j:integer;
begin if n+b-a+5>filenamesize then b:=a+filenamesize-n-5;k:=0;
for j:=1 to n do begin c:=xord[MPmemdefault[j]];k:=k+1;
if k<=filenamesize then nameoffile[k]:=xchr[c];end;
for j:=a to b do begin c:=buffer[j];k:=k+1;
if k<=filenamesize then nameoffile[k]:=xchr[c];end;
for j:=12 to 15 do begin c:=xord[MPmemdefault[j]];k:=k+1;
if k<=filenamesize then nameoffile[k]:=xchr[c];end;
if k<=filenamesize then namelength:=k else namelength:=filenamesize;
for k:=namelength+1 to filenamesize do nameoffile[k]:=' ';end;
{:756}{758:}function makenamestring:strnumber;var k:1..filenamesize;
begin if stroverflowed then makenamestring:=63 else begin begin if
poolptr+namelength>maxpoolptr then if poolptr+namelength>poolsize then
docompaction(namelength)else maxpoolptr:=poolptr+namelength;end;
for k:=1 to namelength do begin strpool[poolptr]:=xord[nameoffile[k]];
poolptr:=poolptr+1;end;makenamestring:=makestring;end;end;
function amakenamestring(var f:alphafile):strnumber;
begin amakenamestring:=makenamestring;end;
function bmakenamestring(var f:bytefile):strnumber;
begin bmakenamestring:=makenamestring;end;
function wmakenamestring(var f:wordfile):strnumber;
begin wmakenamestring:=makenamestring;end;
{:758}{759:}procedure scanfilename;label 30;begin beginname;
while buffer[curinput.locfield]=32 do curinput.locfield:=curinput.
locfield+1;
while true do begin if(buffer[curinput.locfield]=59)or(buffer[curinput.
locfield]=37)then goto 30;
if not morename(buffer[curinput.locfield])then goto 30;
curinput.locfield:=curinput.locfield+1;end;30:endname;end;
{:759}{763:}procedure packjobname(s:strnumber);
begin begin if strref[s]<127 then strref[s]:=strref[s]+1;end;
begin if strref[curname]<127 then if strref[curname]>1 then strref[
curname]:=strref[curname]-1 else flushstring(curname);end;
begin if strref[curarea]<127 then if strref[curarea]>1 then strref[
curarea]:=strref[curarea]-1 else flushstring(curarea);end;
begin if strref[curext]<127 then if strref[curext]>1 then strref[curext]
:=strref[curext]-1 else flushstring(curext);end;curarea:=287;curext:=s;
curname:=jobname;packfilename(curname,curarea,curext);end;
{:763}{764:}procedure promptfilename(s,e:strnumber);label 30;
var k:0..bufsize;begin if interaction=2 then;
if s=813 then begin if interaction=3 then;printnl(263);print(814);
end else begin if interaction=3 then;printnl(263);print(815);end;
printfilename(curname,curarea,curext);print(816);
if e=287 then showcontext;printnl(817);print(s);
if interaction<2 then fatalerror(818);breakin(termin,true);begin;
print(819);terminput;end;{765:}begin beginname;k:=first;
while(buffer[k]=32)and(k<last)do k:=k+1;
while true do begin if k=last then goto 30;
if not morename(buffer[k])then goto 30;k:=k+1;end;30:endname;end{:765};
if curext=287 then curext:=e;packfilename(curname,curarea,curext);end;
{:764}{766:}procedure openlogfile;var oldsetting:0..10;k:0..bufsize;
l:0..bufsize;m:integer;months:packed array[1..36]of char;
begin oldsetting:=selector;if jobname=0 then jobname:=820;
packjobname(821);while not aopenout(logfile)do{767:}begin selector:=8;
promptfilename(823,821);end{:767};logname:=amakenamestring(logfile);
selector:=9;logopened:=true;
{768:}begin write(logfile,'This is MetaPost, Version 0.993');
print(memident);print(824);printint(roundunscaled(internal[15]));
printchar(32);months:='JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';
m:=roundunscaled(internal[14]);
for k:=3*m-2 to 3*m do write(logfile,months[k]);printchar(32);
printint(roundunscaled(internal[13]));printchar(32);
m:=roundunscaled(internal[16]);printdd(m div 60);printchar(58);
printdd(m mod 60);end{:768};inputstack[inputptr]:=curinput;printnl(822);
l:=inputstack[0].limitfield-1;for k:=1 to l do print(buffer[k]);println;
selector:=oldsetting+2;end;
{:766}{769:}function tryextension(ext:strnumber):boolean;
begin packfilename(curname,curarea,ext);
inamestack[curinput.indexfield]:=curname;
iareastack[curinput.indexfield]:=curarea;
if aopenin(inputfile[curinput.indexfield])then tryextension:=true else
begin if strvsstr(ext,825)=0 then iareastack[curinput.indexfield]:=810
else iareastack[curinput.indexfield]:=809;
packfilename(curname,iareastack[curinput.indexfield],ext);
tryextension:=aopenin(inputfile[curinput.indexfield]);end;end;
{:769}{771:}procedure startinput;label 30;
begin{774:}while(curinput.indexfield>6)and(curinput.locfield=0)do
endtokenlist;
if(curinput.indexfield>6)then begin begin if interaction=3 then;
printnl(263);print(827);end;begin helpptr:=3;helpline[2]:=828;
helpline[1]:=829;helpline[0]:=830;end;error;end;
if(curinput.indexfield<=6)then scanfilename else begin curname:=287;
curext:=287;curarea:=287;end{:774};while true do begin beginfilereading;
if curext=287 then if tryextension(826)then goto 30 else if tryextension
(287)then goto 30 else if tryextension(825)then goto 30 else else if
tryextension(curext)then goto 30;endfilereading;promptfilename(813,287);
end;
30:curinput.namefield:=amakenamestring(inputfile[curinput.indexfield]);
{770:}if inamestack[curinput.indexfield]=curname then begin if strref[
curname]<127 then strref[curname]:=strref[curname]+1;end;
if iareastack[curinput.indexfield]=curarea then begin if strref[curarea]
<127 then strref[curarea]:=strref[curarea]+1;end{:770};
if jobname=0 then begin jobname:=curname;strref[jobname]:=127;
openlogfile;end;
if termoffset+(strstart[nextstr[curinput.namefield]]-strstart[curinput.
namefield])>maxprintline-2 then println else if(termoffset>0)or(
fileoffset>0)then printchar(32);printchar(40);openparens:=openparens+1;
print(curinput.namefield);break(termout);
{772:}flushstring(curinput.namefield);curinput.namefield:=curname;
curname:=0{:772};{773:}begin linestack[curinput.indexfield]:=1;
if inputln(inputfile[curinput.indexfield],false)then;firmuptheline;
buffer[curinput.limitfield]:=37;first:=curinput.limitfield+1;
curinput.locfield:=curinput.startfield;end{:773};end;
{:771}{775:}procedure copyoldname(s:strnumber);var k:integer;
j:poolpointer;begin k:=0;
for j:=strstart[s]to strstart[nextstr[s]]-1 do begin k:=k+1;
if k<=filenamesize then oldfilename[k]:=xchr[strpool[j]];end;
if k<=filenamesize then oldnamelength:=k else oldnamelength:=
filenamesize;
for k:=oldnamelength+1 to filenamesize do oldfilename[k]:=' ';end;
{:775}{777:}procedure startmpxinput;label 10,45;var k:1..filenamesize;
begin packfilename(inamestack[curinput.indexfield],iareastack[curinput.
indexfield],831);{778:}copyoldname(curinput.namefield){:778};
beginfilereading;
if not aopenin(inputfile[curinput.indexfield])then begin endfilereading;
goto 45;end;
curinput.namefield:=amakenamestring(inputfile[curinput.indexfield]);
mpxname[curinput.indexfield]:=curinput.namefield;
begin if strref[curinput.namefield]<127 then strref[curinput.namefield]
:=strref[curinput.namefield]+1;end;
{773:}begin linestack[curinput.indexfield]:=1;
if inputln(inputfile[curinput.indexfield],false)then;firmuptheline;
buffer[curinput.limitfield]:=37;first:=curinput.limitfield+1;
curinput.locfield:=curinput.startfield;end{:773};goto 10;
45:{779:}if interaction=3 then;printnl(832);
for k:=1 to oldnamelength do print(xord[oldfilename[k]]);printnl(832);
for k:=1 to namelength do print(xord[nameoffile[k]]);printnl(833);
begin helpptr:=4;helpline[3]:=834;helpline[2]:=835;helpline[1]:=836;
helpline[0]:=837;end;begin if interaction=3 then interaction:=2;
if logopened then error;{if interaction>0 then debughelp;}history:=3;
jumpout;end;{:779};10:end;
{:777}{783:}function startreadinput(s:strnumber;n:readfindex):boolean;
label 10,45;begin strscanfile(s);packfilename(curname,curarea,curext);
beginfilereading;if not aopenin(rdfile[n])then goto 45;
if not inputln(rdfile[n],false)then begin aclose(rdfile[n]);goto 45;end;
rdfname[n]:=s;begin if strref[s]<127 then strref[s]:=strref[s]+1;end;
startreadinput:=true;goto 10;45:endfilereading;startreadinput:=false;
10:end;{:783}{784:}procedure openwritefile(s:strnumber;n:readfindex);
begin strscanfile(s);packfilename(curname,curarea,curext);
while not aopenout(wrfile[n])do promptfilename(838,287);wrfname[n]:=s;
begin if strref[s]<127 then strref[s]:=strref[s]+1;end;end;
{:784}{813:}procedure badexp(s:strnumber);var saveflag:0..84;
begin begin if interaction=3 then;printnl(263);print(s);end;print(846);
printcmdmod(curcmd,curmod);printchar(39);begin helpptr:=4;
helpline[3]:=847;helpline[2]:=848;helpline[1]:=849;helpline[0]:=850;end;
backinput;cursym:=0;curcmd:=44;curmod:=0;inserror;saveflag:=varflag;
varflag:=0;getxnext;varflag:=saveflag;end;
{:813}{816:}procedure stashin(p:halfword);var q:halfword;
begin mem[p].hh.b0:=curtype;
if curtype=17 then mem[p+1].int:=curexp else begin if curtype=20 then
{818:}begin q:=singledependency(curexp);
if q=depfinal then begin mem[p].hh.b0:=17;mem[p+1].int:=0;freenode(q,2);
end else begin mem[p].hh.b0:=18;newdep(p,q);end;recyclevalue(curexp);
end{:818}else begin mem[p+1]:=mem[curexp+1];
mem[mem[p+1].hh.lh].hh.rh:=p;end;freenode(curexp,2);end;curtype:=1;end;
{:816}{840:}procedure backexpr;var p:halfword;begin p:=stashcurexp;
mem[p].hh.rh:=0;begintokenlist(p,10);end;
{:840}{841:}procedure badsubscript;begin disperr(0,868);
begin helpptr:=3;helpline[2]:=869;helpline[1]:=870;helpline[0]:=871;end;
flusherror(0);end;{:841}{843:}procedure obliterated(q:halfword);
begin begin if interaction=3 then;printnl(263);print(872);end;
showtokenlist(q,0,1000,0);print(873);begin helpptr:=5;helpline[4]:=874;
helpline[3]:=875;helpline[2]:=876;helpline[1]:=877;helpline[0]:=878;end;
end;{:843}{855:}procedure binarymac(p,c,n:halfword);var q,r:halfword;
begin q:=getavail;r:=getavail;mem[q].hh.rh:=r;mem[q].hh.lh:=p;
mem[r].hh.lh:=stashcurexp;macrocall(c,q,n);end;
{:855}{860:}{861:}procedure knownpair;var p:halfword;
begin if curtype<>15 then begin disperr(0,889);begin helpptr:=5;
helpline[4]:=890;helpline[3]:=891;helpline[2]:=892;helpline[1]:=893;
helpline[0]:=894;end;putgetflusherror(0);curx:=0;cury:=0;
end else begin p:=mem[curexp+1].int;
{862:}if mem[p].hh.b0=17 then curx:=mem[p+1].int else begin disperr(p,
895);begin helpptr:=5;helpline[4]:=896;helpline[3]:=891;
helpline[2]:=892;helpline[1]:=893;helpline[0]:=894;end;putgeterror;
recyclevalue(p);curx:=0;end;
if mem[p+2].hh.b0=17 then cury:=mem[p+3].int else begin disperr(p+2,897)
;begin helpptr:=5;helpline[4]:=898;helpline[3]:=891;helpline[2]:=892;
helpline[1]:=893;helpline[0]:=894;end;putgeterror;recyclevalue(p+2);
cury:=0;end{:862};flushcurexp(0);end;end;
{:861}function newknot:halfword;var q:halfword;begin q:=getnode(8);
mem[q].hh.b0:=0;mem[q].hh.b1:=0;mem[q+7].hh.b0:=1;mem[q].hh.rh:=q;
knownpair;mem[q+1].int:=curx;mem[q+2].int:=cury;newknot:=q;end;
{:860}{864:}function scandirection:smallnumber;var t:2..4;x:scaled;
begin getxnext;if curcmd=62 then{865:}begin getxnext;scanexpression;
if(curtype<>17)or(curexp<0)then begin disperr(0,901);begin helpptr:=1;
helpline[0]:=902;end;putgetflusherror(65536);end;t:=3;
end{:865}else{866:}begin scanexpression;
if curtype>15 then{867:}begin if curtype<>17 then begin disperr(0,895);
begin helpptr:=5;helpline[4]:=896;helpline[3]:=891;helpline[2]:=892;
helpline[1]:=893;helpline[0]:=894;end;putgetflusherror(0);end;x:=curexp;
if curcmd<>81 then begin missingerr(44);begin helpptr:=2;
helpline[1]:=903;helpline[0]:=904;end;backerror;end;getxnext;
scanexpression;if curtype<>17 then begin disperr(0,897);
begin helpptr:=5;helpline[4]:=898;helpline[3]:=891;helpline[2]:=892;
helpline[1]:=893;helpline[0]:=894;end;putgetflusherror(0);end;
cury:=curexp;curx:=x;end{:867}else knownpair;
if(curx=0)and(cury=0)then t:=4 else begin t:=2;curexp:=narg(curx,cury);
end;end{:866};if curcmd<>67 then begin missingerr(125);begin helpptr:=3;
helpline[2]:=899;helpline[1]:=900;helpline[0]:=763;end;backerror;end;
getxnext;scandirection:=t;end;{:864}{884:}{886:}procedure finishread;
var k:poolpointer;
begin begin if poolptr+last-curinput.startfield>maxpoolptr then if
poolptr+last-curinput.startfield>poolsize then docompaction(last-
curinput.startfield)else maxpoolptr:=poolptr+last-curinput.startfield;
end;
for k:=curinput.startfield to last-1 do begin strpool[poolptr]:=buffer[k
];poolptr:=poolptr+1;end;endfilereading;curtype:=4;curexp:=makestring;
end;{:886}procedure donullary(c:quarterword);
begin begin if aritherror then cleararith;end;
if internal[6]>131072 then showcmdmod(35,c);
case c of 30,31:begin curtype:=2;curexp:=c;end;32:begin curtype:=10;
curexp:=getnode(8);initedges(curexp);end;33:begin curtype:=6;
curexp:=getpencircle(0);end;37:begin curtype:=17;curexp:=normrand;end;
36:begin curtype:=6;curexp:=getpencircle(65536);end;
34:begin if jobname=0 then openlogfile;curtype:=4;curexp:=jobname;end;
129:begin curtype:=4;curexp:=256;end;
35:{885:}begin if interaction<=1 then fatalerror(915);beginfilereading;
curinput.namefield:=1;curinput.limitfield:=curinput.startfield;begin;
print(287);terminput;end;finishread;end{:885};end;
begin if aritherror then cleararith;end;end;
{:884}{887:}{888:}function nicepair(p:integer;t:quarterword):boolean;
label 10;begin if t=15 then begin p:=mem[p+1].int;
if mem[p].hh.b0=17 then if mem[p+2].hh.b0=17 then begin nicepair:=true;
goto 10;end;end;nicepair:=false;10:end;
{:888}{889:}function nicecolororpair(p:integer;t:quarterword):boolean;
label 10;var q,r:halfword;
begin if(t<>15)and(t<>13)and(t<>14)then nicecolororpair:=false else
begin q:=mem[p+1].int;r:=q+bignodesize[mem[p].hh.b0];repeat r:=r-2;
if mem[r].hh.b0<>17 then begin nicecolororpair:=false;goto 10;end;
until r=q;nicecolororpair:=true;end;10:end;
{:889}{890:}procedure printknownorunknowntype(t:smallnumber;v:integer);
begin printchar(40);
if t>17 then print(916)else begin if(t=15)or(t=13)or(t=14)then if not
nicecolororpair(v,t)then print(917);printtype(t);end;printchar(41);end;
{:890}{891:}procedure badunary(c:quarterword);begin disperr(0,918);
printop(c);printknownorunknowntype(curtype,curexp);begin helpptr:=3;
helpline[2]:=919;helpline[1]:=920;helpline[0]:=921;end;putgeterror;end;
{:891}{894:}procedure negatedeplist(p:halfword);label 10;
begin while true do begin mem[p+1].int:=-mem[p+1].int;
if mem[p].hh.lh=0 then goto 10;p:=mem[p].hh.rh;end;10:end;
{:894}{898:}procedure pairtopath;begin curexp:=newknot;curtype:=8;end;
{:898}{900:}procedure takepart(c:quarterword);var p:halfword;
begin p:=mem[curexp+1].int;mem[10].int:=p;mem[9].hh.b0:=curtype;
mem[p].hh.rh:=9;freenode(curexp,2);makeexpcopy(p+sectoroffset[c-50]);
recyclevalue(9);end;{:900}{903:}procedure scaleedges;forward;
procedure takepictpart(c:quarterword);label 10,45;var p:halfword;
begin p:=mem[curexp+7].hh.rh;
if p<>0 then begin case c of 55,56,57,58,59,60:if mem[p].hh.b0=3 then
flushcurexp(mem[p+c-44].int)else goto 45;
61,62,63:if(mem[p].hh.b0<4)then flushcurexp(mem[p+c-58].int)else goto 45
;
64,65,66,67:if(mem[p].hh.b0<4)then if mem[p+2].hh.b0=9 then flushcurexp(
65536)else flushcurexp(mem[p+c+(-3)-58].int)else goto 45;
68:if(mem[p].hh.b0<4)then flushcurexp(mem[p+c+(-7)-58].int)else goto 45;
54:if(mem[p].hh.b0<4)then if mem[p+2].hh.b0=9 then flushcurexp(internal[
34])else flushcurexp(mem[p+2].hh.b0*65536)else goto 45;
{904:}70:if mem[p].hh.b0<>3 then goto 45 else begin flushcurexp(mem[p+1]
.hh.rh);
begin if strref[curexp]<127 then strref[curexp]:=strref[curexp]+1;end;
curtype:=4;end;
69:if mem[p].hh.b0<>3 then goto 45 else begin flushcurexp(fontname[mem[p
+1].hh.lh]);
begin if strref[curexp]<127 then strref[curexp]:=strref[curexp]+1;end;
curtype:=4;end;
71:if mem[p].hh.b0=3 then goto 45 else if(mem[p].hh.b0>=6)then confusion
(923)else begin flushcurexp(copypath(mem[p+1].hh.rh));curtype:=8;end;
72:if not(mem[p].hh.b0<3)then goto 45 else if mem[p+1].hh.lh=0 then goto
45 else begin flushcurexp(makepen(copypath(mem[p+1].hh.lh),false));
curtype:=6;end;
73:if mem[p].hh.b0<>2 then goto 45 else if mem[p+9].hh.rh=0 then goto 45
else begin mem[mem[p+9].hh.rh].hh.lh:=mem[mem[p+9].hh.rh].hh.lh+1;
sesf:=mem[p+10].int;sepic:=mem[p+9].hh.rh;scaleedges;flushcurexp(sepic);
curtype:=10;end;{:904}end;goto 10;end;
45:{906:}case c of 70,69:begin flushcurexp(287);curtype:=4;end;
71:begin flushcurexp(getnode(8));mem[curexp].hh.b0:=0;
mem[curexp].hh.b1:=0;mem[curexp].hh.rh:=curexp;mem[curexp+1].int:=0;
mem[curexp+2].int:=0;mem[curexp+7].hh.b0:=1;curtype:=8;end;
72:begin flushcurexp(getpencircle(0));curtype:=6;end;
73:begin flushcurexp(getnode(8));initedges(curexp);curtype:=10;end;
others:flushcurexp(0)end{:906};10:end;
{:903}{908:}procedure strtonum(c:quarterword);var n:integer;m:ASCIIcode;
k:poolpointer;b:8..16;badchar:boolean;
begin if c=50 then if(strstart[nextstr[curexp]]-strstart[curexp])=0 then
n:=-1 else n:=strpool[strstart[curexp]]else begin if c=48 then b:=8 else
b:=16;n:=0;badchar:=false;
for k:=strstart[curexp]to strstart[nextstr[curexp]]-1 do begin m:=
strpool[k];
if(m>=48)and(m<=57)then m:=m-48 else if(m>=65)and(m<=70)then m:=m-55
else if(m>=97)and(m<=102)then m:=m-87 else begin badchar:=true;m:=0;end;
if m>=b then begin badchar:=true;m:=0;end;
if n<32768 div b then n:=n*b+m else n:=32767;end;
{909:}if badchar then begin disperr(0,924);
if c=48 then begin helpptr:=1;helpline[0]:=925;
end else begin helpptr:=1;helpline[0]:=926;end;putgeterror;end;
if(n>4095)then if internal[30]>0 then begin begin if interaction=3 then;
printnl(263);print(927);end;printint(n);printchar(41);begin helpptr:=2;
helpline[1]:=928;helpline[0]:=630;end;putgeterror;end{:909};end;
flushcurexp(n*65536);end;{:908}{911:}function pathlength:scaled;
var n:scaled;p:halfword;begin p:=curexp;
if mem[p].hh.b0=0 then n:=-65536 else n:=0;repeat p:=mem[p].hh.rh;
n:=n+65536;until p=curexp;pathlength:=n;end;
{:911}{912:}function pictlength:scaled;label 40;var n:scaled;p:halfword;
begin n:=0;p:=mem[curexp+7].hh.rh;
if p<>0 then begin if(mem[p].hh.b0>=4)then if skip1component(p)=0 then p
:=mem[p].hh.rh;
while p<>0 do begin if not(mem[p].hh.b0>=4)then p:=mem[p].hh.rh else if
not(mem[p].hh.b0>=6)then p:=skip1component(p)else goto 40;n:=n+65536;
end;end;40:pictlength:=n;end;
{:912}{915:}function anangle(xpar,ypar:scaled):angle;
begin if(not((xpar=0)and(ypar=0)))then anangle:=narg(xpar,ypar)else
anangle:=0;end;{:915}{916:}function turncycles(c:halfword):scaled;
var res,ang:angle;turns:scaled;p:halfword;begin res:=0;turns:=0;p:=c;
if((mem[p].hh.rh=p)or(mem[mem[p].hh.rh].hh.rh=p))then if anangle(mem[p+1
].int-mem[p+5].int,mem[p+2].int-mem[p+6].int)>=0 then turncycles:=65536
else turncycles:=-65536 else begin repeat ang:=anangle(mem[mem[mem[p].hh
.rh].hh.rh+1].int-mem[mem[p].hh.rh+1].int,mem[mem[mem[p].hh.rh].hh.rh+2]
.int-mem[mem[p].hh.rh+2].int)-anangle(mem[mem[p].hh.rh+1].int-mem[p+1].
int,mem[mem[p].hh.rh+2].int-mem[p+2].int);
if abs(ang)>188743680 then if ang>0 then ang:=ang-377487360 else ang:=
ang+377487360;res:=res+ang;
if res>=377487360 then begin res:=res-377487360;turns:=turns+65536;end;
if res<=-377487360 then begin res:=res+377487360;turns:=turns-65536;end;
p:=mem[p].hh.rh;until p=c;turncycles:=turns;end;end;
{:916}{917:}function countturns(c:halfword):scaled;var p:halfword;
t:integer;begin t:=0;p:=c;repeat t:=t+mem[p].hh.lh-16384;
p:=mem[p].hh.rh;until p=c;countturns:=(t div 3)*65536;end;
{:917}{919:}procedure testknown(c:quarterword);label 30;var b:30..31;
p,q:halfword;begin b:=31;case curtype of 1,2,4,6,8,10,17:b:=30;
12,13,14,15:begin p:=mem[curexp+1].int;q:=p+bignodesize[curtype];
repeat q:=q-2;if mem[q].hh.b0<>17 then goto 30;until q=p;b:=30;30:end;
others:end;if c=41 then flushcurexp(b)else flushcurexp(61-b);curtype:=2;
end;{:919}{924:}procedure pairvalue(x,y:scaled);var p:halfword;
begin p:=getnode(2);flushcurexp(p);curtype:=15;mem[p].hh.b0:=15;
mem[p].hh.b1:=19;initbignode(p);p:=mem[p+1].int;mem[p].hh.b0:=17;
mem[p+1].int:=x;mem[p+2].hh.b0:=17;mem[p+3].int:=y;end;
{:924}{926:}function getcurbbox:boolean;label 10;
begin case curtype of 10:begin setbbox(curexp,true);
if mem[curexp+2].int>mem[curexp+4].int then begin bbmin[0]:=0;
bbmax[0]:=0;bbmin[1]:=0;bbmax[1]:=0;
end else begin bbmin[0]:=mem[curexp+2].int;bbmax[0]:=mem[curexp+4].int;
bbmin[1]:=mem[curexp+3].int;bbmax[1]:=mem[curexp+5].int;end;end;
8:pathbbox(curexp);6:penbbox(curexp);others:begin getcurbbox:=false;
goto 10;end end;getcurbbox:=true;10:end;
{:926}{928:}procedure doreadorclose(c:quarterword);label 10,22,40,45,46;
var n,n0:readfindex;begin{929:}n:=readfiles;n0:=readfiles;
repeat 22:if n>0 then n:=n-1 else if c=39 then goto 46 else{930:}begin
if n0=readfiles then if readfiles<maxreadfiles then readfiles:=readfiles
+1 else overflow(929,maxreadfiles);n:=n0;
if startreadinput(curexp,n)then goto 40 else goto 45;end{:930};
if rdfname[n]=0 then begin n0:=n;goto 22;end;
until strvsstr(curexp,rdfname[n])=0;
if c=39 then begin aclose(rdfile[n]);goto 45;end{:929};beginfilereading;
curinput.namefield:=1;if inputln(rdfile[n],true)then goto 40;
endfilereading;
45:{931:}begin if strref[rdfname[n]]<127 then if strref[rdfname[n]]>1
then strref[rdfname[n]]:=strref[rdfname[n]]-1 else flushstring(rdfname[n
]);end;rdfname[n]:=0;if n=readfiles-1 then readfiles:=n;
if c=39 then goto 46;
{934:}if eofline=0 then begin begin strpool[poolptr]:=0;
poolptr:=poolptr+1;end;eofline:=makestring;strref[eofline]:=127;
end{:934};flushcurexp(eofline);curtype:=4{:931};goto 10;
46:flushcurexp(0);curtype:=1;goto 10;40:flushcurexp(0);finishread;
10:end;{:928}procedure dounary(c:quarterword);var p,q,r:halfword;
x:integer;begin begin if aritherror then cleararith;end;
if internal[6]>131072 then{892:}begin begindiagnostic;printnl(123);
printop(c);printchar(40);printexp(0,0);print(922);enddiagnostic(false);
end{:892};case c of 95:if curtype<13 then badunary(95);
96:{893:}case curtype of 13,14,15,20:begin q:=curexp;makeexpcopy(q);
if curtype=18 then negatedeplist(mem[curexp+1].hh.rh)else if curtype<=15
then begin p:=mem[curexp+1].int;r:=p+bignodesize[curtype];repeat r:=r-2;
if mem[r].hh.b0=17 then mem[r+1].int:=-mem[r+1].int else negatedeplist(
mem[r+1].hh.rh);until r=p;end;recyclevalue(q);freenode(q,2);end;
18,19:negatedeplist(mem[curexp+1].hh.rh);17:curexp:=-curexp;
others:badunary(96)end{:893};
{895:}43:if curtype<>2 then badunary(43)else curexp:=61-curexp;
{:895}{896:}74,75,76,77,78,79,80,40,81:if curtype<>17 then badunary(c)
else case c of 74:curexp:=squarert(curexp);75:curexp:=mexp(curexp);
76:curexp:=mlog(curexp);77,78:begin nsincos((curexp mod 23592960)*16);
if c=77 then curexp:=roundfraction(nsin)else curexp:=roundfraction(ncos)
;end;79:curexp:=floorscaled(curexp);80:curexp:=unifrand(curexp);
40:begin if odd(roundunscaled(curexp))then curexp:=30 else curexp:=31;
curtype:=2;end;81:{1311:}begin curexp:=roundunscaled(curexp)mod 256;
if curexp<0 then curexp:=curexp+256;
if charexists[curexp]then curexp:=30 else curexp:=31;curtype:=2;
end{:1311};end;
{:896}{897:}88:if nicepair(curexp,curtype)then begin p:=mem[curexp+1].
int;x:=narg(mem[p+1].int,mem[p+3].int);
if x>=0 then flushcurexp((x+8)div 16)else flushcurexp(-((-x+8)div 16));
end else badunary(88);
{:897}{899:}55,56:if(curtype=15)or(curtype=12)then takepart(c)else if
curtype=10 then takepictpart(c)else badunary(c);
57,58,59,60:if curtype=12 then takepart(c)else if curtype=10 then
takepictpart(c)else badunary(c);
61,62,63:if curtype=13 then takepart(c)else if curtype=10 then
takepictpart(c)else badunary(c);
64,65,66,67:if curtype=14 then takepart(c)else if curtype=10 then
takepictpart(c)else badunary(c);
68:if curtype=17 then curexp:=mem[c+1].int else if curtype=10 then
takepictpart(c)else badunary(c);
54:if curtype=10 then takepictpart(c)else badunary(c);
{:899}{902:}69,70,71,72,73:if curtype=10 then takepictpart(c)else
badunary(c);
{:902}{907:}51:if curtype<>17 then badunary(51)else begin curexp:=
roundunscaled(curexp)mod 256;curtype:=4;
if curexp<0 then curexp:=curexp+256;end;
44:if curtype<>17 then badunary(44)else begin oldsetting:=selector;
selector:=4;printscaled(curexp);curexp:=makestring;selector:=oldsetting;
curtype:=4;end;48,49,50:if curtype<>4 then badunary(c)else strtonum(c);
82:if curtype<>4 then badunary(82)else{1204:}flushcurexp((fontdsize[
findfont(curexp)]+8)div 16){:1204};
{:907}{910:}52:case curtype of 4:flushcurexp((strstart[nextstr[curexp]]-
strstart[curexp])*65536);8:flushcurexp(pathlength);
17:curexp:=abs(curexp);10:flushcurexp(pictlength);
others:if nicepair(curexp,curtype)then flushcurexp(pythadd(mem[mem[
curexp+1].int+1].int,mem[mem[curexp+1].int+3].int))else badunary(c)end;
{:910}{913:}53:if curtype=15 then flushcurexp(0)else if curtype<>8 then
badunary(53)else if mem[curexp].hh.b0=0 then flushcurexp(0)else begin
flushcurexp(turncycles(curexp));end;
{:913}{918:}2:begin if(curtype>=2)and(curtype<=3)then flushcurexp(30)
else flushcurexp(31);curtype:=2;end;
4:begin if(curtype>=4)and(curtype<=5)then flushcurexp(30)else
flushcurexp(31);curtype:=2;end;
6:begin if(curtype>=6)and(curtype<=7)then flushcurexp(30)else
flushcurexp(31);curtype:=2;end;
8:begin if(curtype>=8)and(curtype<=9)then flushcurexp(30)else
flushcurexp(31);curtype:=2;end;
10:begin if(curtype>=10)and(curtype<=11)then flushcurexp(30)else
flushcurexp(31);curtype:=2;end;
12,13,14,15:begin if curtype=c then flushcurexp(30)else flushcurexp(31);
curtype:=2;end;
16:begin if(curtype>=17)and(curtype<=20)then flushcurexp(30)else
flushcurexp(31);curtype:=2;end;41,42:testknown(c);
{:918}{920:}89:begin if curtype<>8 then flushcurexp(31)else if mem[
curexp].hh.b0<>0 then flushcurexp(30)else flushcurexp(31);curtype:=2;
end;{:920}{921:}87:begin if curtype=15 then pairtopath;
if curtype<>8 then badunary(87)else flushcurexp(getarclength(curexp));
end;
{:921}{922:}90,91,92,93,94:begin if curtype<>10 then flushcurexp(31)else
if mem[curexp+7].hh.rh=0 then flushcurexp(31)else if mem[mem[curexp+7].
hh.rh].hh.b0=c-89 then flushcurexp(30)else flushcurexp(31);curtype:=2;
end;{:922}{923:}47:begin if curtype=15 then pairtopath;
if curtype<>8 then badunary(47)else begin curtype:=6;
curexp:=makepen(curexp,true);end;end;
46:if curtype<>6 then badunary(46)else begin curtype:=8;
makepath(curexp);end;45:if curtype=8 then begin p:=htapypoc(curexp);
if mem[p].hh.b1=0 then p:=mem[p].hh.rh;tossknotlist(curexp);curexp:=p;
end else if curtype=15 then pairtopath else badunary(45);
{:923}{925:}83:if not getcurbbox then badunary(83)else pairvalue(bbmin[0
],bbmin[1]);
84:if not getcurbbox then badunary(84)else pairvalue(bbmax[0],bbmin[1]);
85:if not getcurbbox then badunary(85)else pairvalue(bbmin[0],bbmax[1]);
86:if not getcurbbox then badunary(86)else pairvalue(bbmax[0],bbmax[1]);
{:925}{927:}38,39:if curtype<>4 then badunary(c)else doreadorclose(c);
{:927}end;begin if aritherror then cleararith;end;end;
{:887}{935:}{936:}procedure badbinary(p:halfword;c:quarterword);
begin disperr(p,287);disperr(0,918);if c>=121 then printop(c);
printknownorunknowntype(mem[p].hh.b0,p);
if c>=121 then print(503)else printop(c);
printknownorunknowntype(curtype,curexp);begin helpptr:=3;
helpline[2]:=919;helpline[1]:=930;helpline[0]:=931;end;putgeterror;end;
{:936}{941:}function tarnished(p:halfword):halfword;label 10;
var q:halfword;r:halfword;begin q:=mem[p+1].int;
r:=q+bignodesize[mem[p].hh.b0];repeat r:=r-2;
if mem[r].hh.b0=20 then begin tarnished:=1;goto 10;end;until r=q;
tarnished:=0;10:end;{:941}{943:}{948:}procedure depfinish(v,q:halfword;
t:smallnumber);var p:halfword;vv:scaled;
begin if q=0 then p:=curexp else p:=q;mem[p+1].hh.rh:=v;mem[p].hh.b0:=t;
if mem[v].hh.lh=0 then begin vv:=mem[v+1].int;
if q=0 then flushcurexp(vv)else begin recyclevalue(p);mem[q].hh.b0:=17;
mem[q+1].int:=vv;end;end else if q=0 then curtype:=t;
if fixneeded then fixdependencies;end;
{:948}procedure addorsubtract(p,q:halfword;c:quarterword);label 30,10;
var s,t:smallnumber;r:halfword;v:integer;
begin if q=0 then begin t:=curtype;
if t<18 then v:=curexp else v:=mem[curexp+1].hh.rh;
end else begin t:=mem[q].hh.b0;
if t<18 then v:=mem[q+1].int else v:=mem[q+1].hh.rh;end;
if t=17 then begin if c=96 then v:=-v;
if mem[p].hh.b0=17 then begin v:=slowadd(mem[p+1].int,v);
if q=0 then curexp:=v else mem[q+1].int:=v;goto 10;end;
{944:}r:=mem[p+1].hh.rh;while mem[r].hh.lh<>0 do r:=mem[r].hh.rh;
mem[r+1].int:=slowadd(mem[r+1].int,v);if q=0 then begin q:=getnode(2);
curexp:=q;curtype:=mem[p].hh.b0;mem[q].hh.b1:=19;end;
mem[q+1].hh.rh:=mem[p+1].hh.rh;mem[q].hh.b0:=mem[p].hh.b0;
mem[q+1].hh.lh:=mem[p+1].hh.lh;mem[mem[p+1].hh.lh].hh.rh:=q;
mem[p].hh.b0:=17;{:944};end else begin if c=96 then negatedeplist(v);
{945:}if mem[p].hh.b0=17 then{946:}begin while mem[v].hh.lh<>0 do v:=mem
[v].hh.rh;mem[v+1].int:=slowadd(mem[p+1].int,mem[v+1].int);
end{:946}else begin s:=mem[p].hh.b0;r:=mem[p+1].hh.rh;
if t=18 then begin if s=18 then if maxcoef(r)+maxcoef(v)<626349397 then
begin v:=pplusq(v,r,18);goto 30;end;t:=19;v:=poverv(v,65536,18,19);end;
if s=19 then v:=pplusq(v,r,19)else v:=pplusfq(v,65536,r,19,18);
30:{947:}if q<>0 then depfinish(v,q,t)else begin curtype:=t;
depfinish(v,0,t);end{:947};end{:945};end;10:end;
{:943}{956:}procedure depmult(p:halfword;v:integer;visscaled:boolean);
label 10;var q:halfword;s,t:smallnumber;
begin if p=0 then q:=curexp else if mem[p].hh.b0<>17 then q:=p else
begin if visscaled then mem[p+1].int:=takescaled(mem[p+1].int,v)else mem
[p+1].int:=takefraction(mem[p+1].int,v);goto 10;end;t:=mem[q].hh.b0;
q:=mem[q+1].hh.rh;s:=t;
if t=18 then if visscaled then if abvscd(maxcoef(q),abs(v),626349396,
65536)>=0 then t:=19;q:=ptimesv(q,v,s,t,visscaled);depfinish(q,p,t);
10:end;{:956}{959:}procedure hardtimes(p:halfword);label 30;
var q:halfword;r:halfword;v:scaled;
begin if mem[p].hh.b0<=15 then begin q:=stashcurexp;unstashcurexp(p);
p:=q;end;r:=mem[curexp+1].int+bignodesize[curtype];
while true do begin r:=r-2;v:=mem[r+1].int;mem[r].hh.b0:=mem[p].hh.b0;
if r=mem[curexp+1].int then goto 30;
newdep(r,copydeplist(mem[p+1].hh.rh));depmult(r,v,true);end;
30:mem[r+1]:=mem[p+1];mem[mem[p+1].hh.lh].hh.rh:=r;freenode(p,2);
depmult(r,v,true);end;{:959}{961:}procedure depdiv(p:halfword;v:scaled);
label 10;var q:halfword;s,t:smallnumber;
begin if p=0 then q:=curexp else if mem[p].hh.b0<>17 then q:=p else
begin mem[p+1].int:=makescaled(mem[p+1].int,v);goto 10;end;
t:=mem[q].hh.b0;q:=mem[q+1].hh.rh;s:=t;
if t=18 then if abvscd(maxcoef(q),65536,626349396,abs(v))>=0 then t:=19;
q:=poverv(q,v,s,t);depfinish(q,p,t);10:end;
{:961}{965:}procedure setuptrans(c:quarterword);label 30,10;
var p,q,r:halfword;
begin if(c<>114)or(curtype<>12)then{967:}begin p:=stashcurexp;
curexp:=idtransform;curtype:=12;q:=mem[curexp+1].int;
case c of{969:}110:if mem[p].hh.b0=17 then{970:}begin nsincos((mem[p+1].
int mod 23592960)*16);mem[q+5].int:=roundfraction(ncos);
mem[q+9].int:=roundfraction(nsin);mem[q+7].int:=-mem[q+9].int;
mem[q+11].int:=mem[q+5].int;goto 30;end{:970};
111:if mem[p].hh.b0>15 then begin install(q+6,p);goto 30;end;
112:if mem[p].hh.b0>15 then begin install(q+4,p);install(q+10,p);
goto 30;end;113:if mem[p].hh.b0=15 then begin r:=mem[p+1].int;
install(q,r);install(q+2,r+2);goto 30;end;
115:if mem[p].hh.b0>15 then begin install(q+4,p);goto 30;end;
116:if mem[p].hh.b0>15 then begin install(q+10,p);goto 30;end;
117:if mem[p].hh.b0=15 then{971:}begin r:=mem[p+1].int;install(q+4,r);
install(q+10,r);install(q+8,r+2);
if mem[r+2].hh.b0=17 then mem[r+3].int:=-mem[r+3].int else negatedeplist
(mem[r+3].hh.rh);install(q+6,r+2);goto 30;end{:971};114:;{:969}end;
disperr(p,940);begin helpptr:=3;helpline[2]:=941;helpline[1]:=942;
helpline[0]:=943;end;putgeterror;30:recyclevalue(p);freenode(p,2);
end{:967};{968:}q:=mem[curexp+1].int;r:=q+12;repeat r:=r-2;
if mem[r].hh.b0<>17 then goto 10;until r=q;txx:=mem[q+5].int;
txy:=mem[q+7].int;tyx:=mem[q+9].int;tyy:=mem[q+11].int;tx:=mem[q+1].int;
ty:=mem[q+3].int;flushcurexp(0){:968};10:end;
{:965}{972:}procedure setupknowntrans(c:quarterword);
begin setuptrans(c);if curtype<>17 then begin disperr(0,944);
begin helpptr:=3;helpline[2]:=945;helpline[1]:=946;helpline[0]:=943;end;
putgetflusherror(0);txx:=65536;txy:=0;tyx:=0;tyy:=65536;tx:=0;ty:=0;end;
end;{:972}{973:}procedure trans(p,q:halfword);var v:scaled;
begin v:=takescaled(mem[p].int,txx)+takescaled(mem[q].int,txy)+tx;
mem[q].int:=takescaled(mem[p].int,tyx)+takescaled(mem[q].int,tyy)+ty;
mem[p].int:=v;end;{:973}{974:}procedure dopathtrans(p:halfword);
label 10;var q:halfword;begin q:=p;
repeat if mem[q].hh.b0<>0 then trans(q+3,q+4);trans(q+1,q+2);
if mem[q].hh.b1<>0 then trans(q+5,q+6);q:=mem[q].hh.rh;until q=p;10:end;
{:974}{975:}procedure dopentrans(p:halfword);label 10;var q:halfword;
begin if(p=mem[p].hh.rh)then begin trans(p+3,p+4);trans(p+5,p+6);end;
q:=p;repeat trans(q+1,q+2);q:=mem[q].hh.rh;until q=p;10:end;
{:975}{976:}function edgestrans(h:halfword):halfword;label 31;
var q:halfword;r,s:halfword;sx,sy:scaled;sqdet:scaled;sgndet:integer;
v:scaled;begin h:=privateedges(h);sqdet:=sqrtdet(txx,txy,tyx,tyy);
sgndet:=abvscd(txx,tyy,txy,tyx);
if mem[h].hh.rh<>2 then{977:}if(txy<>0)or(tyx<>0)or(ty<>0)or(abs(txx)<>
abs(tyy))then flushdashlist(h)else begin if txx<0 then{978:}begin r:=mem
[h].hh.rh;mem[h].hh.rh:=2;while r<>2 do begin s:=r;r:=mem[r].hh.rh;
v:=mem[s+1].int;mem[s+1].int:=mem[s+2].int;mem[s+2].int:=v;
mem[s].hh.rh:=mem[h].hh.rh;mem[h].hh.rh:=s;end;end{:978};
{979:}r:=mem[h].hh.rh;
while r<>2 do begin mem[r+1].int:=takescaled(mem[r+1].int,txx)+tx;
mem[r+2].int:=takescaled(mem[r+2].int,txx)+tx;r:=mem[r].hh.rh;end{:979};
mem[h+1].int:=takescaled(mem[h+1].int,abs(tyy));end{:977};
{980:}if(txx=0)and(tyy=0)then{981:}begin v:=mem[h+2].int;
mem[h+2].int:=mem[h+3].int;mem[h+3].int:=v;v:=mem[h+4].int;
mem[h+4].int:=mem[h+5].int;mem[h+5].int:=v;
end{:981}else if(txy<>0)or(tyx<>0)then begin initbbox(h);goto 31;end;
if mem[h+2].int<=mem[h+4].int then{982:}begin mem[h+2].int:=takescaled(
mem[h+2].int,txx+txy)+tx;
mem[h+4].int:=takescaled(mem[h+4].int,txx+txy)+tx;
mem[h+3].int:=takescaled(mem[h+3].int,tyx+tyy)+ty;
mem[h+5].int:=takescaled(mem[h+5].int,tyx+tyy)+ty;
if txx+txy<0 then begin v:=mem[h+2].int;mem[h+2].int:=mem[h+4].int;
mem[h+4].int:=v;end;if tyx+tyy<0 then begin v:=mem[h+3].int;
mem[h+3].int:=mem[h+5].int;mem[h+5].int:=v;end;end{:982};31:{:980};
q:=mem[h+7].hh.rh;
while q<>0 do begin{983:}case mem[q].hh.b0 of 1,2:begin dopathtrans(mem[
q+1].hh.rh);{984:}if mem[q+1].hh.lh<>0 then begin sx:=tx;sy:=ty;tx:=0;
ty:=0;dopentrans(mem[q+1].hh.lh);
if((mem[q].hh.b0=2)and(mem[q+9].hh.rh<>0))then mem[q+10].int:=takescaled
(mem[q+10].int,sqdet);
if not(mem[q+1].hh.lh=mem[mem[q+1].hh.lh].hh.rh)then if sgndet<0 then
mem[q+1].hh.lh:=makepen(copypath(mem[q+1].hh.lh),true);tx:=sx;ty:=sy;
end{:984};end;4,5:dopathtrans(mem[q+1].hh.rh);3:begin r:=q+11;
{985:}trans(r,r+1);sx:=tx;sy:=ty;tx:=0;ty:=0;trans(r+2,r+4);
trans(r+3,r+5);tx:=sx;ty:=sy{:985};end;6,7:;end{:983};q:=mem[q].hh.rh;
end;edgestrans:=h;end;procedure doedgestrans(p:halfword;c:quarterword);
begin setupknowntrans(c);mem[p+1].int:=edgestrans(mem[p+1].int);
unstashcurexp(p);end;procedure scaleedges;begin txx:=sesf;tyy:=sesf;
txy:=0;tyx:=0;tx:=0;ty:=0;sepic:=edgestrans(sepic);end;
{:976}{986:}{988:}procedure bilin1(p:halfword;t:scaled;q:halfword;
u,delta:scaled);var r:halfword;begin if t<>65536 then depmult(p,t,true);
if u<>0 then if mem[q].hh.b0=17 then delta:=delta+takescaled(mem[q+1].
int,u)else begin{989:}if mem[p].hh.b0<>19 then begin if mem[p].hh.b0=17
then newdep(p,constdependency(mem[p+1].int))else mem[p+1].hh.rh:=ptimesv
(mem[p+1].hh.rh,65536,18,19,true);mem[p].hh.b0:=19;end{:989};
mem[p+1].hh.rh:=pplusfq(mem[p+1].hh.rh,u,mem[q+1].hh.rh,19,mem[q].hh.b0)
;end;
if mem[p].hh.b0=17 then mem[p+1].int:=mem[p+1].int+delta else begin r:=
mem[p+1].hh.rh;while mem[r].hh.lh<>0 do r:=mem[r].hh.rh;
delta:=mem[r+1].int+delta;
if r<>mem[p+1].hh.rh then mem[r+1].int:=delta else begin recyclevalue(p)
;mem[p].hh.b0:=17;mem[p+1].int:=delta;end;end;
if fixneeded then fixdependencies;end;
{:988}{991:}procedure addmultdep(p:halfword;v:scaled;r:halfword);
begin if mem[r].hh.b0=17 then mem[depfinal+1].int:=mem[depfinal+1].int+
takescaled(mem[r+1].int,v)else begin mem[p+1].hh.rh:=pplusfq(mem[p+1].hh
.rh,v,mem[r+1].hh.rh,19,mem[r].hh.b0);if fixneeded then fixdependencies;
end;end;{:991}{992:}procedure bilin2(p,t:halfword;v:scaled;
u,q:halfword);var vv:scaled;begin vv:=mem[p+1].int;mem[p].hh.b0:=19;
newdep(p,constdependency(0));if vv<>0 then addmultdep(p,vv,t);
if v<>0 then addmultdep(p,v,u);if q<>0 then addmultdep(p,65536,q);
if mem[p+1].hh.rh=depfinal then begin vv:=mem[depfinal+1].int;
recyclevalue(p);mem[p].hh.b0:=17;mem[p+1].int:=vv;end;end;
{:992}{994:}procedure bilin3(p:halfword;t,v,u,delta:scaled);
begin if t<>65536 then delta:=delta+takescaled(mem[p+1].int,t)else delta
:=delta+mem[p+1].int;
if u<>0 then mem[p+1].int:=delta+takescaled(v,u)else mem[p+1].int:=delta
;end;{:994}procedure bigtrans(p:halfword;c:quarterword);label 10;
var q,r,pp,qq:halfword;s:smallnumber;begin s:=bignodesize[mem[p].hh.b0];
q:=mem[p+1].int;r:=q+s;repeat r:=r-2;
if mem[r].hh.b0<>17 then{987:}begin setupknowntrans(c);makeexpcopy(p);
r:=mem[curexp+1].int;
if curtype=12 then begin bilin1(r+10,tyy,q+6,tyx,0);
bilin1(r+8,tyy,q+4,tyx,0);bilin1(r+6,txx,q+10,txy,0);
bilin1(r+4,txx,q+8,txy,0);end;bilin1(r+2,tyy,q,tyx,ty);
bilin1(r,txx,q+2,txy,tx);goto 10;end{:987};until r=q;
{990:}setuptrans(c);if curtype=17 then{993:}begin makeexpcopy(p);
r:=mem[curexp+1].int;
if curtype=12 then begin bilin3(r+10,tyy,mem[q+7].int,tyx,0);
bilin3(r+8,tyy,mem[q+5].int,tyx,0);bilin3(r+6,txx,mem[q+11].int,txy,0);
bilin3(r+4,txx,mem[q+9].int,txy,0);end;
bilin3(r+2,tyy,mem[q+1].int,tyx,ty);bilin3(r,txx,mem[q+3].int,txy,tx);
end{:993}else begin pp:=stashcurexp;qq:=mem[pp+1].int;makeexpcopy(p);
r:=mem[curexp+1].int;
if curtype=12 then begin bilin2(r+10,qq+10,mem[q+7].int,qq+8,0);
bilin2(r+8,qq+10,mem[q+5].int,qq+8,0);
bilin2(r+6,qq+4,mem[q+11].int,qq+6,0);
bilin2(r+4,qq+4,mem[q+9].int,qq+6,0);end;
bilin2(r+2,qq+10,mem[q+1].int,qq+8,qq+2);
bilin2(r,qq+4,mem[q+3].int,qq+6,qq);recyclevalue(pp);freenode(pp,2);end;
{:990};10:end;{:986}{996:}procedure cat(p:halfword);var a,b:strnumber;
k:poolpointer;begin a:=mem[p+1].int;b:=curexp;
begin if poolptr+(strstart[nextstr[a]]-strstart[a])+(strstart[nextstr[b]
]-strstart[b])>maxpoolptr then if poolptr+(strstart[nextstr[a]]-strstart
[a])+(strstart[nextstr[b]]-strstart[b])>poolsize then docompaction((
strstart[nextstr[a]]-strstart[a])+(strstart[nextstr[b]]-strstart[b]))
else maxpoolptr:=poolptr+(strstart[nextstr[a]]-strstart[a])+(strstart[
nextstr[b]]-strstart[b]);end;
for k:=strstart[a]to strstart[nextstr[a]]-1 do begin strpool[poolptr]:=
strpool[k];poolptr:=poolptr+1;end;
for k:=strstart[b]to strstart[nextstr[b]]-1 do begin strpool[poolptr]:=
strpool[k];poolptr:=poolptr+1;end;curexp:=makestring;
begin if strref[b]<127 then if strref[b]>1 then strref[b]:=strref[b]-1
else flushstring(b);end;end;
{:996}{997:}procedure chopstring(p:halfword);var a,b:integer;l:integer;
k:integer;s:strnumber;reversed:boolean;
begin a:=roundunscaled(mem[p+1].int);b:=roundunscaled(mem[p+3].int);
if a<=b then reversed:=false else begin reversed:=true;k:=a;a:=b;b:=k;
end;s:=curexp;l:=(strstart[nextstr[s]]-strstart[s]);
if a<0 then begin a:=0;if b<0 then b:=0;end;if b>l then begin b:=l;
if a>l then a:=l;end;
begin if poolptr+b-a>maxpoolptr then if poolptr+b-a>poolsize then
docompaction(b-a)else maxpoolptr:=poolptr+b-a;end;
if reversed then for k:=strstart[s]+b-1 downto strstart[s]+a do begin
strpool[poolptr]:=strpool[k];poolptr:=poolptr+1;
end else for k:=strstart[s]+a to strstart[s]+b-1 do begin strpool[
poolptr]:=strpool[k];poolptr:=poolptr+1;end;curexp:=makestring;
begin if strref[s]<127 then if strref[s]>1 then strref[s]:=strref[s]-1
else flushstring(s);end;end;{:997}{998:}procedure choppath(p:halfword);
var q:halfword;pp,qq,rr,ss:halfword;a,b,k,l:scaled;reversed:boolean;
begin l:=pathlength;a:=mem[p+1].int;b:=mem[p+3].int;
if a<=b then reversed:=false else begin reversed:=true;k:=a;a:=b;b:=k;
end;{999:}if a<0 then if mem[curexp].hh.b0=0 then begin a:=0;
if b<0 then b:=0;end else repeat a:=a+l;b:=b+l;until a>=0;
if b>l then if mem[curexp].hh.b0=0 then begin b:=l;if a>l then a:=l;
end else while a>=l do begin a:=a-l;b:=b-l;end{:999};q:=curexp;
while a>=65536 do begin q:=mem[q].hh.rh;a:=a-65536;b:=b-65536;end;
if b=a then{1001:}begin if a>0 then begin splitcubic(q,a*4096);
q:=mem[q].hh.rh;end;pp:=copyknot(q);qq:=pp;
end{:1001}else{1000:}begin pp:=copyknot(q);qq:=pp;
repeat q:=mem[q].hh.rh;rr:=qq;qq:=copyknot(q);mem[rr].hh.rh:=qq;
b:=b-65536;until b<=0;if a>0 then begin ss:=pp;pp:=mem[pp].hh.rh;
splitcubic(ss,a*4096);pp:=mem[ss].hh.rh;freenode(ss,8);
if rr=ss then begin b:=makescaled(b,65536-a);rr:=pp;end;end;
if b<0 then begin splitcubic(rr,(b+65536)*4096);freenode(qq,8);
qq:=mem[rr].hh.rh;end;end{:1000};mem[pp].hh.b0:=0;mem[qq].hh.b1:=0;
mem[qq].hh.rh:=pp;tossknotlist(curexp);
if reversed then begin curexp:=mem[htapypoc(pp)].hh.rh;tossknotlist(pp);
end else curexp:=pp;end;{:998}{1003:}procedure setupoffset(p:halfword);
begin findoffset(mem[p+1].int,mem[p+3].int,curexp);pairvalue(curx,cury);
end;procedure setupdirectiontime(p:halfword);
begin flushcurexp(finddirectiontime(mem[p+1].int,mem[p+3].int,curexp));
end;{:1003}{1004:}procedure findpoint(v:scaled;c:quarterword);
var p:halfword;n:scaled;begin p:=curexp;
if mem[p].hh.b0=0 then n:=-65536 else n:=0;repeat p:=mem[p].hh.rh;
n:=n+65536;until p=curexp;
if n=0 then v:=0 else if v<0 then if mem[p].hh.b0=0 then v:=0 else v:=n
-1-((-v-1)mod n)else if v>n then if mem[p].hh.b0=0 then v:=n else v:=v
mod n;p:=curexp;while v>=65536 do begin p:=mem[p].hh.rh;v:=v-65536;end;
if v<>0 then{1005:}begin splitcubic(p,v*4096);p:=mem[p].hh.rh;
end{:1005};{1006:}case c of 124:pairvalue(mem[p+1].int,mem[p+2].int);
125:if mem[p].hh.b0=0 then pairvalue(mem[p+1].int,mem[p+2].int)else
pairvalue(mem[p+3].int,mem[p+4].int);
126:if mem[p].hh.b1=0 then pairvalue(mem[p+1].int,mem[p+2].int)else
pairvalue(mem[p+5].int,mem[p+6].int);end{:1006};end;
{:1004}{1010:}procedure doinfont(p:halfword);var q:halfword;
begin q:=getnode(8);initedges(q);
mem[mem[q+7].hh.lh].hh.rh:=newtextnode(curexp,mem[p+1].int);
mem[q+7].hh.lh:=mem[mem[q+7].hh.lh].hh.rh;freenode(p,2);flushcurexp(q);
curtype:=10;end;{:1010}procedure dobinary(p:halfword;c:quarterword);
label 30,31,10;var q,r,rr:halfword;oldp,oldexp:halfword;v:integer;
begin begin if aritherror then cleararith;end;
if internal[6]>131072 then{937:}begin begindiagnostic;printnl(932);
printexp(p,0);printchar(41);printop(c);printchar(40);printexp(0,0);
print(922);enddiagnostic(false);end{:937};
{939:}case mem[p].hh.b0 of 12,13,14,15:oldp:=tarnished(p);20:oldp:=1;
others:oldp:=0 end;if oldp<>0 then begin q:=stashcurexp;oldp:=p;
makeexpcopy(oldp);p:=stashcurexp;unstashcurexp(q);end;{:939};
{940:}case curtype of 12,13,14,15:oldexp:=tarnished(curexp);
20:oldexp:=1;others:oldexp:=0 end;
if oldexp<>0 then begin oldexp:=curexp;makeexpcopy(oldexp);end{:940};
case c of 95,96:{942:}if(curtype<13)or(mem[p].hh.b0<13)then badbinary(p,
c)else if(curtype>15)and(mem[p].hh.b0>15)then addorsubtract(p,0,c)else
if curtype<>mem[p].hh.b0 then badbinary(p,c)else begin q:=mem[p+1].int;
r:=mem[curexp+1].int;rr:=r+bignodesize[curtype];
while r<rr do begin addorsubtract(q,r,c);q:=q+2;r:=r+2;end;end{:942};
{949:}103,104,105,106,107,108:begin begin if aritherror then cleararith;
end;if(curtype>15)and(mem[p].hh.b0>15)then addorsubtract(p,0,96)else if
curtype<>mem[p].hh.b0 then begin badbinary(p,c);goto 30;
end else if curtype=4 then flushcurexp(strvsstr(mem[p+1].int,curexp))
else if(curtype=5)or(curtype=3)then{951:}begin q:=mem[curexp+1].int;
while(q<>curexp)and(q<>p)do q:=mem[q+1].int;if q=p then flushcurexp(0);
end{:951}else if(curtype<=15)and(curtype>=12)then{952:}begin q:=mem[p+1]
.int;r:=mem[curexp+1].int;rr:=r+bignodesize[curtype]-2;
while true do begin addorsubtract(q,r,96);
if mem[r].hh.b0<>17 then goto 31;if mem[r+1].int<>0 then goto 31;
if r=rr then goto 31;q:=q+2;r:=r+2;end;31:takepart(mem[r].hh.b1+50);
end{:952}else if curtype=2 then flushcurexp(curexp-mem[p+1].int)else
begin badbinary(p,c);goto 30;end;
{950:}if curtype<>17 then begin if curtype<17 then begin disperr(p,287);
begin helpptr:=1;helpline[0]:=933;end end else begin helpptr:=2;
helpline[1]:=934;helpline[0]:=935;end;disperr(0,936);
putgetflusherror(31);
end else case c of 103:if curexp<0 then curexp:=30 else curexp:=31;
104:if curexp<=0 then curexp:=30 else curexp:=31;
105:if curexp>0 then curexp:=30 else curexp:=31;
106:if curexp>=0 then curexp:=30 else curexp:=31;
107:if curexp=0 then curexp:=30 else curexp:=31;
108:if curexp<>0 then curexp:=30 else curexp:=31;end;curtype:=2{:950};
30:aritherror:=false;end;
{:949}{953:}102,101:if(mem[p].hh.b0<>2)or(curtype<>2)then badbinary(p,c)
else if mem[p+1].int=c-71 then curexp:=mem[p+1].int;
{:953}{954:}97:if(curtype<13)or(mem[p].hh.b0<13)then badbinary(p,97)else
if(curtype=17)or(mem[p].hh.b0=17)then{955:}begin if mem[p].hh.b0=17 then
begin v:=mem[p+1].int;freenode(p,2);end else begin v:=curexp;
unstashcurexp(p);end;
if curtype=17 then curexp:=takescaled(curexp,v)else if(curtype=15)or(
curtype=13)or(curtype=14)then begin p:=mem[curexp+1].int+bignodesize[
curtype];repeat p:=p-2;depmult(p,v,true);until p=mem[curexp+1].int;
end else depmult(0,v,true);goto 10;
end{:955}else if(nicecolororpair(p,mem[p].hh.b0)and(curtype>15))or(
nicecolororpair(curexp,curtype)and(mem[p].hh.b0>15))then begin hardtimes
(p);goto 10;end else badbinary(p,97);
{:954}{960:}98:if(curtype<>17)or(mem[p].hh.b0<13)then badbinary(p,98)
else begin v:=curexp;unstashcurexp(p);
if v=0 then{962:}begin disperr(0,866);begin helpptr:=2;helpline[1]:=938;
helpline[0]:=939;end;putgeterror;
end{:962}else begin if curtype=17 then curexp:=makescaled(curexp,v)else
if curtype<=15 then begin p:=mem[curexp+1].int+bignodesize[curtype];
repeat p:=p-2;depdiv(p,v);until p=mem[curexp+1].int;
end else depdiv(0,v);end;goto 10;end;
{:960}{963:}99,100:if(curtype=17)and(mem[p].hh.b0=17)then if c=99 then
curexp:=pythadd(mem[p+1].int,curexp)else curexp:=pythsub(mem[p+1].int,
curexp)else badbinary(p,c);
{:963}{964:}110,111,112,113,114,115,116,117:if mem[p].hh.b0=8 then begin
begin setupknowntrans(c);unstashcurexp(p);dopathtrans(curexp);end;
goto 10;end else if mem[p].hh.b0=6 then begin begin setupknowntrans(c);
unstashcurexp(p);dopentrans(curexp);end;curexp:=convexhull(curexp);
goto 10;
end else if(mem[p].hh.b0=15)or(mem[p].hh.b0=12)then bigtrans(p,c)else if
mem[p].hh.b0=10 then begin doedgestrans(p,c);goto 10;
end else badbinary(p,c);
{:964}{995:}109:if(curtype=4)and(mem[p].hh.b0=4)then cat(p)else
badbinary(p,109);
121:if nicepair(p,mem[p].hh.b0)and(curtype=4)then chopstring(mem[p+1].
int)else badbinary(p,121);122:begin if curtype=15 then pairtopath;
if nicepair(p,mem[p].hh.b0)and(curtype=8)then choppath(mem[p+1].int)else
badbinary(p,122);end;
{:995}{1002:}124,125,126:begin if curtype=15 then pairtopath;
if(curtype=8)and(mem[p].hh.b0=17)then findpoint(mem[p+1].int,c)else
badbinary(p,c);end;
127:if(curtype=6)and nicepair(p,mem[p].hh.b0)then setupoffset(mem[p+1].
int)else badbinary(p,127);123:begin if curtype=15 then pairtopath;
if(curtype=8)and nicepair(p,mem[p].hh.b0)then setupdirectiontime(mem[p+1
].int)else badbinary(p,123);end;
{:1002}{1007:}128:begin if curtype=15 then pairtopath;
if(curtype=8)and(mem[p].hh.b0=17)then flushcurexp(getarctime(curexp,mem[
p+1].int))else badbinary(p,c);end;
{:1007}{1008:}119:begin if mem[p].hh.b0=15 then begin q:=stashcurexp;
unstashcurexp(p);pairtopath;p:=stashcurexp;unstashcurexp(q);end;
if curtype=15 then pairtopath;
if(curtype=8)and(mem[p].hh.b0=8)then begin pathintersection(mem[p+1].int
,curexp);pairvalue(curt,curtt);end else badbinary(p,119);end;
{:1008}{1009:}118:if(curtype<>4)or(mem[p].hh.b0<>4)then badbinary(p,118)
else begin doinfont(p);goto 10;end;{:1009}end;recyclevalue(p);
freenode(p,2);10:begin if aritherror then cleararith;end;
{938:}if oldp<>0 then begin recyclevalue(oldp);freenode(oldp,2);end;
if oldexp<>0 then begin recyclevalue(oldexp);freenode(oldexp,2);
end{:938};end;{:935}{957:}procedure fracmult(n,d:scaled);var p:halfword;
oldexp:halfword;v:fraction;
begin if internal[6]>131072 then{958:}begin begindiagnostic;
printnl(932);printscaled(n);printchar(47);printscaled(d);print(937);
printexp(0,0);print(922);enddiagnostic(false);end{:958};
case curtype of 12,13,14,15:oldexp:=tarnished(curexp);20:oldexp:=1;
others:oldexp:=0 end;if oldexp<>0 then begin oldexp:=curexp;
makeexpcopy(oldexp);end;v:=makefraction(n,d);
if curtype=17 then curexp:=takefraction(curexp,v)else if curtype<=15
then begin p:=mem[curexp+1].int+bignodesize[curtype];repeat p:=p-2;
depmult(p,v,false);until p=mem[curexp+1].int;
end else depmult(0,v,false);
if oldexp<>0 then begin recyclevalue(oldexp);freenode(oldexp,2);end end;
{:957}{1011:}{1017:}{1028:}procedure tryeq(l,r:halfword);label 30,31;
var p:halfword;t:17..20;q:halfword;pp:halfword;tt:18..20;copied:boolean;
begin{1029:}t:=mem[l].hh.b0;if t=17 then begin t:=18;
p:=constdependency(-mem[l+1].int);q:=p;
end else if t=20 then begin t:=18;p:=singledependency(l);
mem[p+1].int:=-mem[p+1].int;q:=depfinal;
end else begin p:=mem[l+1].hh.rh;q:=p;
while true do begin mem[q+1].int:=-mem[q+1].int;
if mem[q].hh.lh=0 then goto 30;q:=mem[q].hh.rh;end;
30:mem[mem[l+1].hh.lh].hh.rh:=mem[q].hh.rh;
mem[mem[q].hh.rh+1].hh.lh:=mem[l+1].hh.lh;mem[l].hh.b0:=17;end{:1029};
{1031:}if r=0 then if curtype=17 then begin mem[q+1].int:=mem[q+1].int+
curexp;goto 31;end else begin tt:=curtype;
if tt=20 then pp:=singledependency(curexp)else pp:=mem[curexp+1].hh.rh;
end else if mem[r].hh.b0=17 then begin mem[q+1].int:=mem[q+1].int+mem[r
+1].int;goto 31;end else begin tt:=mem[r].hh.b0;
if tt=20 then pp:=singledependency(r)else pp:=mem[r+1].hh.rh;end;
if tt<>20 then copied:=false else begin copied:=true;tt:=18;end;
{1032:}watchcoefs:=false;
if t=tt then p:=pplusq(p,pp,t)else if t=19 then p:=pplusfq(p,65536,pp,19
,18)else begin q:=p;
while mem[q].hh.lh<>0 do begin mem[q+1].int:=roundfraction(mem[q+1].int)
;q:=mem[q].hh.rh;end;t:=19;p:=pplusq(p,pp,t);end;watchcoefs:=true;
{:1032};if copied then flushnodelist(pp);31:{:1031};
if mem[p].hh.lh=0 then{1030:}begin if abs(mem[p+1].int)>64 then begin
begin if interaction=3 then;printnl(263);print(975);end;print(977);
printscaled(mem[p+1].int);printchar(41);begin helpptr:=2;
helpline[1]:=976;helpline[0]:=974;end;putgeterror;
end else if r=0 then{578:}begin begin if interaction=3 then;
printnl(263);print(635);end;begin helpptr:=2;helpline[1]:=636;
helpline[0]:=637;end;putgeterror;end{:578};freenode(p,2);
end{:1030}else begin lineareq(p,t);
if r=0 then if curtype<>17 then if mem[curexp].hh.b0=17 then begin pp:=
curexp;curexp:=mem[curexp+1].int;curtype:=17;freenode(pp,2);end;end;end;
{:1028}{1023:}procedure makeeq(lhs:halfword);label 20,30,45;
var t:smallnumber;v:integer;p,q:halfword;begin 20:t:=mem[lhs].hh.b0;
if t<=15 then v:=mem[lhs+1].int;
case t of{1025:}2,4,6,8,10:if curtype=t+1 then begin nonlineareq(v,
curexp,false);goto 30;
end else if curtype=t then{1026:}begin if curtype<=4 then begin if
curtype=4 then begin if strvsstr(v,curexp)<>0 then goto 45;
end else if v<>curexp then goto 45;
{578:}begin begin if interaction=3 then;printnl(263);print(635);end;
begin helpptr:=2;helpline[1]:=636;helpline[0]:=637;end;putgeterror;
end{:578};goto 30;end;begin if interaction=3 then;printnl(263);
print(972);end;begin helpptr:=2;helpline[1]:=973;helpline[0]:=974;end;
putgeterror;goto 30;45:begin if interaction=3 then;printnl(263);
print(975);end;begin helpptr:=2;helpline[1]:=976;helpline[0]:=974;end;
putgeterror;goto 30;end{:1026};
3,5,7,11,9:if curtype=t-1 then begin nonlineareq(curexp,lhs,true);
goto 30;end else if curtype=t then begin ringmerge(lhs,curexp);goto 30;
end else if curtype=15 then if t=9 then begin pairtopath;goto 20;end;
12,13,14,15:if curtype=t then{1027:}begin p:=v+bignodesize[t];
q:=mem[curexp+1].int+bignodesize[t];repeat p:=p-2;q:=q-2;tryeq(p,q);
until p=v;goto 30;end{:1027};
17,18,19,20:if curtype>=17 then begin tryeq(lhs,0);goto 30;end;1:;
{:1025}end;{1024:}disperr(lhs,287);disperr(0,969);
if mem[lhs].hh.b0<=15 then printtype(mem[lhs].hh.b0)else print(344);
printchar(61);if curtype<=15 then printtype(curtype)else print(344);
printchar(41);begin helpptr:=2;helpline[1]:=970;helpline[0]:=971;end;
putgeterror{:1024};30:begin if aritherror then cleararith;end;
recyclevalue(lhs);freenode(lhs,2);end;{:1023}procedure doassignment;
forward;procedure doequation;var lhs:halfword;p:halfword;
begin lhs:=stashcurexp;getxnext;varflag:=76;scanexpression;
if curcmd=53 then doequation else if curcmd=76 then doassignment;
if internal[6]>131072 then{1019:}begin begindiagnostic;printnl(932);
printexp(lhs,0);print(964);printexp(0,0);print(922);
enddiagnostic(false);end{:1019};
if curtype=9 then if mem[lhs].hh.b0=15 then begin p:=stashcurexp;
unstashcurexp(lhs);lhs:=p;end;makeeq(lhs);end;
{:1017}{1018:}procedure doassignment;var lhs:halfword;p:halfword;
q:halfword;begin if curtype<>21 then begin disperr(0,961);
begin helpptr:=2;helpline[1]:=962;helpline[0]:=963;end;error;doequation;
end else begin lhs:=curexp;curtype:=1;getxnext;varflag:=76;
scanexpression;
if curcmd=53 then doequation else if curcmd=76 then doassignment;
if internal[6]>131072 then{1020:}begin begindiagnostic;printnl(123);
if mem[lhs].hh.lh>2371 then print(intname[mem[lhs].hh.lh-(2371)])else
showtokenlist(lhs,0,1000,0);print(490);printexp(0,0);printchar(125);
enddiagnostic(false);end{:1020};
if mem[lhs].hh.lh>2371 then{1021:}if curtype=17 then internal[mem[lhs].
hh.lh-(2371)]:=curexp else begin disperr(0,965);
print(intname[mem[lhs].hh.lh-(2371)]);print(966);begin helpptr:=2;
helpline[1]:=967;helpline[0]:=968;end;putgeterror;
end{:1021}else{1022:}begin p:=findvariable(lhs);
if p<>0 then begin q:=stashcurexp;curtype:=undtype(p);recyclevalue(p);
mem[p].hh.b0:=curtype;mem[p+1].int:=0;makeexpcopy(p);p:=stashcurexp;
unstashcurexp(q);makeeq(p);end else begin obliterated(lhs);putgeterror;
end;end{:1022};flushnodelist(lhs);end;end;
{:1018}{1037:}procedure dotypedeclaration;var t:smallnumber;p:halfword;
q:halfword;begin if curmod>=12 then t:=curmod else t:=curmod+1;
repeat p:=scandeclaredvariable;
flushvariable(eqtb[mem[p].hh.lh].rh,mem[p].hh.rh,false);
q:=findvariable(p);if q<>0 then begin mem[q].hh.b0:=t;mem[q+1].int:=0;
end else begin begin if interaction=3 then;printnl(263);print(979);end;
begin helpptr:=2;helpline[1]:=980;helpline[0]:=981;end;putgeterror;end;
flushlist(p);if curcmd<81 then{1038:}begin begin if interaction=3 then;
printnl(263);print(982);end;begin helpptr:=5;helpline[4]:=983;
helpline[3]:=984;helpline[2]:=985;helpline[1]:=986;helpline[0]:=987;end;
if curcmd=44 then helpline[2]:=988;putgeterror;scannerstatus:=2;
repeat begin getnext;if curcmd<=3 then tnext;end;
{716:}if curcmd=41 then begin if strref[curmod]<127 then if strref[
curmod]>1 then strref[curmod]:=strref[curmod]-1 else flushstring(curmod)
;end{:716};until curcmd>=81;scannerstatus:=0;end{:1038};until curcmd>81;
end;{:1037}{1043:}procedure dorandomseed;begin getxnext;
if curcmd<>76 then begin missingerr(490);begin helpptr:=1;
helpline[0]:=993;end;backerror;end;getxnext;scanexpression;
if curtype<>17 then begin disperr(0,994);begin helpptr:=2;
helpline[1]:=995;helpline[0]:=996;end;putgetflusherror(0);
end else{1044:}begin initrandoms(curexp);
if selector>=9 then begin oldsetting:=selector;selector:=9;printnl(997);
printscaled(curexp);printchar(125);printnl(287);selector:=oldsetting;
end;end{:1044};end;{:1043}{1051:}procedure doprotection;var m:0..1;
t:halfword;begin m:=curmod;repeat getsymbol;t:=eqtb[cursym].lh;
if m=0 then begin if t>=85 then eqtb[cursym].lh:=t-85;
end else if t<85 then eqtb[cursym].lh:=t+85;getxnext;until curcmd<>81;
end;{:1051}{1053:}procedure defdelims;var ldelim,rdelim:halfword;
begin getclearsymbol;ldelim:=cursym;getclearsymbol;rdelim:=cursym;
eqtb[ldelim].lh:=33;eqtb[ldelim].rh:=rdelim;eqtb[rdelim].lh:=64;
eqtb[rdelim].rh:=ldelim;getxnext;end;
{:1053}{1056:}procedure dostatement;forward;procedure dointerim;
begin getxnext;if curcmd<>42 then begin begin if interaction=3 then;
printnl(263);print(1003);end;
if cursym=0 then print(1008)else print(hash[cursym].rh);print(1009);
begin helpptr:=1;helpline[0]:=1010;end;backerror;
end else begin saveinternal(curmod);backinput;end;dostatement;end;
{:1056}{1057:}procedure dolet;var l:halfword;begin getsymbol;l:=cursym;
getxnext;if curcmd<>53 then if curcmd<>76 then begin missingerr(61);
begin helpptr:=3;helpline[2]:=1011;helpline[1]:=738;helpline[0]:=1012;
end;backerror;end;getsymbol;
case curcmd of 13,55,46,51:mem[curmod].hh.lh:=mem[curmod].hh.lh+1;
others:end;clearsymbol(l,false);eqtb[l].lh:=curcmd;
if curcmd=43 then eqtb[l].rh:=0 else eqtb[l].rh:=curmod;getxnext;end;
{:1057}{1058:}procedure donewinternal;
begin repeat if intptr=maxinternal then overflow(1013,maxinternal);
getclearsymbol;intptr:=intptr+1;eqtb[cursym].lh:=42;
eqtb[cursym].rh:=intptr;intname[intptr]:=hash[cursym].rh;
internal[intptr]:=0;getxnext;until curcmd<>81;end;
{:1058}{1062:}procedure doshow;begin repeat getxnext;scanexpression;
printnl(832);printexp(0,2);flushcurexp(0);until curcmd<>81;end;
{:1062}{1063:}procedure disptoken;begin printnl(1019);
if cursym=0 then{1064:}begin if curcmd=44 then printscaled(curmod)else
if curcmd=40 then begin gpointer:=curmod;printcapsule;
end else begin printchar(34);print(curmod);printchar(34);
begin if strref[curmod]<127 then if strref[curmod]>1 then strref[curmod]
:=strref[curmod]-1 else flushstring(curmod);end;end;
end{:1064}else begin print(hash[cursym].rh);printchar(61);
if eqtb[cursym].lh>=85 then print(1020);printcmdmod(curcmd,curmod);
if curcmd=13 then begin println;showmacro(curmod,0,100000);end;end;end;
{:1063}{1066:}procedure doshowtoken;begin repeat begin getnext;
if curcmd<=3 then tnext;end;disptoken;getxnext;until curcmd<>81;end;
{:1066}{1067:}procedure doshowstats;begin printnl(1029);
{printint(varused);printchar(38);printint(dynused);if false then}
print(363);print(1030);printint(himemmin-lomemmax-1);print(1031);
println;printnl(1032);{printint(strsinuse-initstruse);printchar(38);
printint(poolinuse-initpoolptr);if false then}print(363);print(1030);
printint(maxstrings-1-strsusedup);printchar(38);
printint(poolsize-poolptr);print(1033);println;getxnext;end;
{:1067}{1068:}procedure dispvar(p:halfword);var q:halfword;
n:0..maxprintline;
begin if mem[p].hh.b0=22 then{1069:}begin q:=mem[p+1].hh.lh;
repeat dispvar(q);q:=mem[q].hh.rh;until q=9;q:=mem[p+1].hh.rh;
while mem[q].hh.b1=3 do begin dispvar(q);q:=mem[q].hh.rh;end;
end{:1069}else if mem[p].hh.b0>=23 then{1070:}begin printnl(287);
printvariablename(p);if mem[p].hh.b0>23 then print(730);print(1034);
if fileoffset>=maxprintline-20 then n:=5 else n:=maxprintline-fileoffset
-15;showmacro(mem[p+1].int,0,n);
end{:1070}else if mem[p].hh.b0<>0 then begin printnl(287);
printvariablename(p);printchar(61);printexp(p,0);end;end;
{:1068}{1071:}procedure doshowvar;label 30;begin repeat begin getnext;
if curcmd<=3 then tnext;end;
if cursym>0 then if cursym<=2371 then if curcmd=43 then if curmod<>0
then begin dispvar(curmod);goto 30;end;disptoken;30:getxnext;
until curcmd<>81;end;{:1071}{1072:}procedure doshowdependencies;
var p:halfword;begin p:=mem[5].hh.rh;
while p<>5 do begin if interesting(p)then begin printnl(287);
printvariablename(p);
if mem[p].hh.b0=18 then printchar(61)else print(844);
printdependency(mem[p+1].hh.rh,mem[p].hh.b0);end;p:=mem[p+1].hh.rh;
while mem[p].hh.lh<>0 do p:=mem[p].hh.rh;p:=mem[p].hh.rh;end;getxnext;
end;{:1072}{1073:}procedure doshowwhatever;begin if interaction=3 then;
case curmod of 0:doshowtoken;1:doshowstats;2:doshow;3:doshowvar;
4:doshowdependencies;end;
if internal[25]>0 then begin begin if interaction=3 then;printnl(263);
print(1035);end;if interaction<3 then begin helpptr:=0;
errorcount:=errorcount-1;end else begin helpptr:=1;helpline[0]:=1036;
end;if curcmd=82 then error else putgeterror;end;end;
{:1073}{1077:}procedure scanwithlist(p:halfword);label 30,31,32;
var t:smallnumber;q:halfword;oldsetting:0..10;k:halfword;s:strnumber;
cp,pp,dp,ap,bp:halfword;begin cp:=1;pp:=1;dp:=1;ap:=1;bp:=1;
while curcmd=68 do begin t:=curmod;getxnext;if t<>1 then scanexpression;
if((t=11)and(curtype<>4))or((t=13)and(curtype<>4))or((t=9)and((curtype<>
14)and(curtype<>13)and(curtype<>17)and(curtype<>2)))or((t=7)and(curtype
<>14))or((t=5)and(curtype<>13))or((t=3)and(curtype<>17))or((t=6)and(
curtype<>t))or((t=10)and(curtype<>t))then{1078:}begin disperr(0,1049);
begin helpptr:=2;helpline[1]:=1050;helpline[0]:=1051;end;
if t=11 then helpline[1]:=1052 else if t=13 then helpline[1]:=1053 else
if t=10 then helpline[1]:=1054 else if t=9 then helpline[1]:=1055 else
if t=5 then helpline[1]:=1056 else if t=7 then helpline[1]:=1057 else if
t=3 then helpline[1]:=1058;putgetflusherror(0);
end{:1078}else if t=9 then begin if cp=1 then{1084:}begin cp:=p;
while cp<>0 do begin if(mem[cp].hh.b0<4)then goto 30;cp:=mem[cp].hh.rh;
end;30:;end{:1084};
if cp<>0 then{1079:}begin if curtype=13 then{1080:}begin q:=mem[curexp+1
].int;mem[cp+3].int:=0;mem[cp+4].int:=0;mem[cp+5].int:=0;
mem[cp+6].int:=0;mem[cp+3].int:=mem[q+1].int;
mem[cp+4].int:=mem[q+3].int;mem[cp+5].int:=mem[q+5].int;
mem[cp+2].hh.b0:=5;if mem[cp+3].int<0 then mem[cp+3].int:=0;
if mem[cp+4].int<0 then mem[cp+4].int:=0;
if mem[cp+5].int<0 then mem[cp+5].int:=0;
if mem[cp+3].int>65536 then mem[cp+3].int:=65536;
if mem[cp+4].int>65536 then mem[cp+4].int:=65536;
if mem[cp+5].int>65536 then mem[cp+5].int:=65536;
end{:1080}else if curtype=14 then{1081:}begin q:=mem[curexp+1].int;
mem[cp+3].int:=mem[q+1].int;mem[cp+4].int:=mem[q+3].int;
mem[cp+5].int:=mem[q+5].int;mem[cp+6].int:=mem[q+7].int;
mem[cp+2].hh.b0:=7;if mem[cp+3].int<0 then mem[cp+3].int:=0;
if mem[cp+4].int<0 then mem[cp+4].int:=0;
if mem[cp+5].int<0 then mem[cp+5].int:=0;
if mem[cp+6].int<0 then mem[cp+6].int:=0;
if mem[cp+3].int>65536 then mem[cp+3].int:=65536;
if mem[cp+4].int>65536 then mem[cp+4].int:=65536;
if mem[cp+5].int>65536 then mem[cp+5].int:=65536;
if mem[cp+6].int>65536 then mem[cp+6].int:=65536;
end{:1081}else if curtype=17 then{1082:}begin q:=curexp;
mem[cp+3].int:=0;mem[cp+4].int:=0;mem[cp+5].int:=0;mem[cp+6].int:=0;
mem[cp+3].int:=q;mem[cp+2].hh.b0:=3;
if mem[cp+3].int<0 then mem[cp+3].int:=0;
if mem[cp+3].int>65536 then mem[cp+3].int:=65536;
end{:1082}else if curexp=31 then{1083:}begin mem[cp+3].int:=0;
mem[cp+4].int:=0;mem[cp+5].int:=0;mem[cp+6].int:=0;mem[cp+3].int:=0;
mem[cp+2].hh.b0:=1;end{:1083};end{:1079};flushcurexp(0);
end else if t=5 then begin if cp=1 then{1085:}begin cp:=p;
while cp<>0 do begin if(mem[cp].hh.b0<4)then goto 36;cp:=mem[cp].hh.rh;
end;36:;end{:1085};if cp<>0 then{1080:}begin q:=mem[curexp+1].int;
mem[cp+3].int:=0;mem[cp+4].int:=0;mem[cp+5].int:=0;mem[cp+6].int:=0;
mem[cp+3].int:=mem[q+1].int;mem[cp+4].int:=mem[q+3].int;
mem[cp+5].int:=mem[q+5].int;mem[cp+2].hh.b0:=5;
if mem[cp+3].int<0 then mem[cp+3].int:=0;
if mem[cp+4].int<0 then mem[cp+4].int:=0;
if mem[cp+5].int<0 then mem[cp+5].int:=0;
if mem[cp+3].int>65536 then mem[cp+3].int:=65536;
if mem[cp+4].int>65536 then mem[cp+4].int:=65536;
if mem[cp+5].int>65536 then mem[cp+5].int:=65536;end{:1080};
flushcurexp(0);
end else if t=7 then begin if cp=1 then{1086:}begin cp:=p;
while cp<>0 do begin if(mem[cp].hh.b0<4)then goto 35;cp:=mem[cp].hh.rh;
end;35:;end{:1086};if cp<>0 then{1081:}begin q:=mem[curexp+1].int;
mem[cp+3].int:=mem[q+1].int;mem[cp+4].int:=mem[q+3].int;
mem[cp+5].int:=mem[q+5].int;mem[cp+6].int:=mem[q+7].int;
mem[cp+2].hh.b0:=7;if mem[cp+3].int<0 then mem[cp+3].int:=0;
if mem[cp+4].int<0 then mem[cp+4].int:=0;
if mem[cp+5].int<0 then mem[cp+5].int:=0;
if mem[cp+6].int<0 then mem[cp+6].int:=0;
if mem[cp+3].int>65536 then mem[cp+3].int:=65536;
if mem[cp+4].int>65536 then mem[cp+4].int:=65536;
if mem[cp+5].int>65536 then mem[cp+5].int:=65536;
if mem[cp+6].int>65536 then mem[cp+6].int:=65536;end{:1081};
flushcurexp(0);
end else if t=3 then begin if cp=1 then{1087:}begin cp:=p;
while cp<>0 do begin if(mem[cp].hh.b0<4)then goto 34;cp:=mem[cp].hh.rh;
end;34:;end{:1087};if cp<>0 then{1082:}begin q:=curexp;mem[cp+3].int:=0;
mem[cp+4].int:=0;mem[cp+5].int:=0;mem[cp+6].int:=0;mem[cp+3].int:=q;
mem[cp+2].hh.b0:=3;if mem[cp+3].int<0 then mem[cp+3].int:=0;
if mem[cp+3].int>65536 then mem[cp+3].int:=65536;end{:1082};
flushcurexp(0);
end else if t=1 then begin if cp=1 then{1088:}begin cp:=p;
while cp<>0 do begin if(mem[cp].hh.b0<4)then goto 33;cp:=mem[cp].hh.rh;
end;33:;end{:1088};if cp<>0 then{1083:}begin mem[cp+3].int:=0;
mem[cp+4].int:=0;mem[cp+5].int:=0;mem[cp+6].int:=0;mem[cp+3].int:=0;
mem[cp+2].hh.b0:=1;end{:1083};
end else if t=6 then begin if pp=1 then{1089:}begin pp:=p;
while pp<>0 do begin if(mem[pp].hh.b0<3)then goto 31;pp:=mem[pp].hh.rh;
end;31:;end{:1089};
if pp<>0 then begin if mem[pp+1].hh.lh<>0 then tossknotlist(mem[pp+1].hh
.lh);mem[pp+1].hh.lh:=curexp;curtype:=1;end;
end else if t=11 then begin if ap=1 then ap:=p;
while(ap<>0)and(not(mem[ap].hh.b0<4))do ap:=mem[ap].hh.rh;
if ap<>0 then begin if mem[ap+8].hh.lh<>0 then begin s:=mem[ap+8].hh.lh;
oldsetting:=selector;selector:=4;
begin if poolptr+(strstart[nextstr[mem[ap+8].hh.lh]]-strstart[mem[ap+8].
hh.lh])+(strstart[nextstr[curexp]]-strstart[curexp])+2>maxpoolptr then
if poolptr+(strstart[nextstr[mem[ap+8].hh.lh]]-strstart[mem[ap+8].hh.lh]
)+(strstart[nextstr[curexp]]-strstart[curexp])+2>poolsize then
docompaction((strstart[nextstr[mem[ap+8].hh.lh]]-strstart[mem[ap+8].hh.
lh])+(strstart[nextstr[curexp]]-strstart[curexp])+2)else maxpoolptr:=
poolptr+(strstart[nextstr[mem[ap+8].hh.lh]]-strstart[mem[ap+8].hh.lh])+(
strstart[nextstr[curexp]]-strstart[curexp])+2;end;print(curexp);
begin strpool[poolptr]:=13;poolptr:=poolptr+1;end;
print(mem[ap+8].hh.lh);mem[ap+8].hh.lh:=makestring;
begin if strref[s]<127 then if strref[s]>1 then strref[s]:=strref[s]-1
else flushstring(s);end;selector:=oldsetting;
end else mem[ap+8].hh.lh:=curexp;curtype:=1;end;
end else if t=13 then begin if bp=1 then k:=p;bp:=k;
while mem[k].hh.rh<>0 do begin k:=mem[k].hh.rh;
if(mem[k].hh.b0<4)then bp:=k;end;
if bp<>0 then begin if mem[bp+8].hh.rh<>0 then begin s:=mem[bp+8].hh.rh;
oldsetting:=selector;selector:=4;
begin if poolptr+(strstart[nextstr[mem[bp+8].hh.rh]]-strstart[mem[bp+8].
hh.rh])+(strstart[nextstr[curexp]]-strstart[curexp])+2>maxpoolptr then
if poolptr+(strstart[nextstr[mem[bp+8].hh.rh]]-strstart[mem[bp+8].hh.rh]
)+(strstart[nextstr[curexp]]-strstart[curexp])+2>poolsize then
docompaction((strstart[nextstr[mem[bp+8].hh.rh]]-strstart[mem[bp+8].hh.
rh])+(strstart[nextstr[curexp]]-strstart[curexp])+2)else maxpoolptr:=
poolptr+(strstart[nextstr[mem[bp+8].hh.rh]]-strstart[mem[bp+8].hh.rh])+(
strstart[nextstr[curexp]]-strstart[curexp])+2;end;
print(mem[bp+8].hh.rh);begin strpool[poolptr]:=13;poolptr:=poolptr+1;
end;print(curexp);mem[bp+8].hh.rh:=makestring;
begin if strref[s]<127 then if strref[s]>1 then strref[s]:=strref[s]-1
else flushstring(s);end;selector:=oldsetting;
end else mem[bp+8].hh.rh:=curexp;curtype:=1;end;
end else begin if dp=1 then{1090:}begin dp:=p;
while dp<>0 do begin if mem[dp].hh.b0=2 then goto 32;dp:=mem[dp].hh.rh;
end;32:;end{:1090};
if dp<>0 then begin if mem[dp+9].hh.rh<>0 then if mem[mem[dp+9].hh.rh].
hh.lh=0 then tossedges(mem[dp+9].hh.rh)else mem[mem[dp+9].hh.rh].hh.lh:=
mem[mem[dp+9].hh.rh].hh.lh-1;mem[dp+9].hh.rh:=makedashes(curexp);
mem[dp+10].int:=65536;curtype:=1;end;end;end;
{1091:}{1092:}begin q:=mem[cp].hh.rh;
while q<>0 do begin if(mem[q].hh.b0<4)then begin mem[q+3].int:=mem[cp+3]
.int;mem[q+4].int:=mem[cp+4].int;mem[q+5].int:=mem[cp+5].int;
mem[q+6].int:=mem[cp+6].int;mem[q+2].hh.b0:=mem[cp+2].hh.b0;end;
q:=mem[q].hh.rh;end;end{:1092};
if pp>1 then{1093:}begin q:=mem[pp].hh.rh;
while q<>0 do begin if(mem[q].hh.b0<3)then begin if mem[q+1].hh.lh<>0
then tossknotlist(mem[q+1].hh.lh);
mem[q+1].hh.lh:=makepen(copypath(mem[pp+1].hh.lh),false);end;
q:=mem[q].hh.rh;end;end{:1093};
if dp>1 then{1094:}begin q:=mem[dp].hh.rh;
while q<>0 do begin if mem[q].hh.b0=2 then begin if mem[q+9].hh.rh<>0
then if mem[mem[q+9].hh.rh].hh.lh=0 then tossedges(mem[q+9].hh.rh)else
mem[mem[q+9].hh.rh].hh.lh:=mem[mem[q+9].hh.rh].hh.lh-1;
mem[q+9].hh.rh:=mem[dp+9].hh.rh;mem[q+10].int:=65536;
if mem[q+9].hh.rh<>0 then mem[mem[q+9].hh.rh].hh.lh:=mem[mem[q+9].hh.rh]
.hh.lh+1;end;q:=mem[q].hh.rh;end;end{:1094}{:1091};end;
{:1077}{1095:}function findedgesvar(t:halfword):halfword;var p:halfword;
curedges:halfword;begin p:=findvariable(t);curedges:=0;
if p=0 then begin obliterated(t);putgeterror;
end else if mem[p].hh.b0<>10 then begin begin if interaction=3 then;
printnl(263);print(872);end;showtokenlist(t,0,1000,0);print(1059);
printtype(mem[p].hh.b0);printchar(41);begin helpptr:=2;
helpline[1]:=1060;helpline[0]:=1061;end;putgeterror;
end else begin mem[p+1].int:=privateedges(mem[p+1].int);
curedges:=mem[p+1].int;end;flushnodelist(t);findedgesvar:=curedges;end;
{:1095}{1100:}function startdrawcmd(sep:quarterword):halfword;
var lhv:halfword;addtype:quarterword;begin lhv:=0;getxnext;varflag:=sep;
scanprimary;if curtype<>21 then{1101:}begin disperr(0,1064);
begin helpptr:=4;helpline[3]:=1065;helpline[2]:=1066;helpline[1]:=1067;
helpline[0]:=1061;end;putgetflusherror(0);
end{:1101}else begin lhv:=curexp;addtype:=curmod;curtype:=1;getxnext;
scanexpression;end;lastaddtype:=addtype;startdrawcmd:=lhv;end;
{:1100}{1102:}procedure dobounds;var lhv,lhe:halfword;p:halfword;
m:integer;begin m:=curmod;lhv:=startdrawcmd(71);
if lhv<>0 then begin lhe:=findedgesvar(lhv);
if lhe=0 then flushcurexp(0)else if curtype<>8 then begin disperr(0,1068
);begin helpptr:=2;helpline[1]:=1069;helpline[0]:=1061;end;
putgetflusherror(0);
end else if mem[curexp].hh.b0=0 then{1103:}begin begin if interaction=3
then;printnl(263);print(1070);end;begin helpptr:=2;helpline[1]:=1071;
helpline[0]:=1061;end;putgeterror;
end{:1103}else{1104:}begin p:=newboundsnode(curexp,m);
mem[p].hh.rh:=mem[lhe+7].hh.rh;mem[lhe+7].hh.rh:=p;
if mem[lhe+7].hh.lh=lhe+7 then mem[lhe+7].hh.lh:=p;
p:=getnode(grobjectsize[(m+2)]);mem[p].hh.b0:=(m+2);
mem[mem[lhe+7].hh.lh].hh.rh:=p;mem[lhe+7].hh.lh:=p;initbbox(lhe);
end{:1104};end;end;{:1102}{1105:}procedure doaddto;var lhv,lhe:halfword;
p:halfword;e:halfword;addtype:quarterword;begin lhv:=startdrawcmd(69);
addtype:=lastaddtype;
if lhv<>0 then begin if addtype=2 then{1107:}begin p:=0;e:=0;
if curtype<>10 then begin disperr(0,1072);begin helpptr:=2;
helpline[1]:=1073;helpline[0]:=1061;end;putgetflusherror(0);
end else begin e:=privateedges(curexp);curtype:=1;p:=mem[e+7].hh.rh;end;
end{:1107}else{1108:}begin e:=0;p:=0;if curtype=15 then pairtopath;
if curtype<>8 then begin disperr(0,1072);begin helpptr:=2;
helpline[1]:=1069;helpline[0]:=1061;end;putgetflusherror(0);
end else if addtype=1 then if mem[curexp].hh.b0=0 then{1103:}begin begin
if interaction=3 then;printnl(263);print(1070);end;begin helpptr:=2;
helpline[1]:=1071;helpline[0]:=1061;end;putgeterror;
end{:1103}else begin p:=newfillnode(curexp);curtype:=1;
end else begin p:=newstrokednode(curexp);curtype:=1;end;end{:1108};
scanwithlist(p);{1109:}lhe:=findedgesvar(lhv);
if lhe=0 then begin if(e=0)and(p<>0)then e:=tossgrobject(p);
if e<>0 then if mem[e].hh.lh=0 then tossedges(e)else mem[e].hh.lh:=mem[e
].hh.lh-1;
end else if addtype=2 then if e<>0 then{1110:}begin if mem[e+7].hh.rh<>0
then begin mem[mem[lhe+7].hh.lh].hh.rh:=mem[e+7].hh.rh;
mem[lhe+7].hh.lh:=mem[e+7].hh.lh;mem[e+7].hh.lh:=e+7;mem[e+7].hh.rh:=0;
flushdashlist(lhe);end;tossedges(e);
end{:1110}else else if p<>0 then begin mem[mem[lhe+7].hh.lh].hh.rh:=p;
mem[lhe+7].hh.lh:=p;
if addtype=0 then if mem[p+1].hh.lh=0 then mem[p+1].hh.lh:=getpencircle(
0);end{:1109};end;end;
{:1105}{1112:}{1143:}function tfmcheck(m:smallnumber):scaled;
begin if abs(internal[m])>=134217728 then begin begin if interaction=3
then;printnl(263);print(1091);end;print(intname[m]);print(1092);
begin helpptr:=1;helpline[0]:=1093;end;putgeterror;
if internal[m]>0 then tfmcheck:=134217727 else tfmcheck:=-134217727;
end else tfmcheck:=internal[m];end;
{:1143}{1212:}procedure psprintcmd(l:strnumber;s:strnumber);
begin if internal[36]>0 then begin if psoffset+(strstart[nextstr[s]]-
strstart[s])>maxprintline then println;print(s);
end else begin if psoffset+(strstart[nextstr[l]]-strstart[l])>
maxprintline then println;print(l);end;end;
procedure printcmd(l:strnumber;s:strnumber);
begin if internal[36]>0 then print(s)else print(l);end;
function mpcharmarked(f:fontnumber;c:eightbits):boolean;var b:integer;
begin b:=charbase[f];
if(c>=fontbc[f])and(c<=fontec[f])and(fontinfo[b+c].qqqq.b3<>0)then
mpcharmarked:=true else mpcharmarked:=false;end;
{:1212}{1217:}procedure readpsnametable;label 50,30;var k:fontnumber;
lmax:integer;j:integer;c:char;s:strnumber;begin nameoffile:=pstabname;
if aopenin(pstabfile)then begin{1219:}lmax:=0;
for k:=lastpsfnum+1 to lastfnum do if(strstart[nextstr[fontname[k]]]-
strstart[fontname[k]])>lmax then lmax:=(strstart[nextstr[fontname[k]]]-
strstart[fontname[k]]){:1219};
while not eof(pstabfile)do begin{1220:}begin if poolptr+lmax>maxpoolptr
then if poolptr+lmax>poolsize then docompaction(lmax)else maxpoolptr:=
poolptr+lmax;end;j:=lmax;
while true do begin if eoln(pstabfile)then fatalerror(1161);
read(pstabfile,c);if c=' 'then goto 30;j:=j-1;
if j>=0 then begin strpool[poolptr]:=xord[c];poolptr:=poolptr+1;
end else begin poolptr:=strstart[strptr];goto 50;end;end;
30:s:=makestring{:1220};
for k:=lastpsfnum+1 to lastfnum do if strvsstr(s,fontname[k])=0 then
{1221:}begin flushstring(s);j:=32;
begin if poolptr+j>maxpoolptr then if poolptr+j>poolsize then
docompaction(j)else maxpoolptr:=poolptr+j;end;
repeat if eoln(pstabfile)then fatalerror(1161);read(pstabfile,c);
until c<>' ';repeat j:=j-1;if j<0 then fatalerror(1161);
begin strpool[poolptr]:=xord[c];poolptr:=poolptr+1;end;
if eoln(pstabfile)then c:=' 'else read(pstabfile,c);until c=' ';
begin if strref[fontpsname[k]]<127 then if strref[fontpsname[k]]>1 then
strref[fontpsname[k]]:=strref[fontpsname[k]]-1 else flushstring(
fontpsname[k]);end;fontpsname[k]:=makestring;goto 50;end{:1221};
flushstring(s);50:readln(pstabfile);end;lastpsfnum:=lastfnum;
aclose(pstabfile);end;end;{:1217}{1223:}procedure openoutputfile;
label 22;var c:integer;oldsetting:0..10;s,n:strnumber;i:poolpointer;
cc:integer;f,g:integer;begin if jobname=0 then openlogfile;
c:=roundunscaled(internal[17]);
if filenametemplate=0 then begin if c<0 then s:=1162 else{1224:}begin
oldsetting:=selector;selector:=4;printchar(46);printint(c);
s:=makestring;selector:=oldsetting;end{:1224};packjobname(s);
while not aopenout(psfile)do promptfilename(1163,s);
end else begin s:=287;n:=287;oldsetting:=selector;selector:=4;f:=0;
i:=strstart[filenametemplate];
while i<strstart[nextstr[filenametemplate]]do begin if strpool[i]=37
then begin 22:i:=i+1;
if i<strstart[nextstr[filenametemplate]]then begin if strpool[i]=106
then print(jobname)else if strpool[i]=100 then begin cc:=roundunscaled(
internal[15]);g:=poolptr;printint(cc);g:=poolptr-g;
if f>g then begin poolptr:=poolptr-g;while f>g do begin printchar(48);
f:=f-1;end;printint(cc);end;f:=0;
end else if strpool[i]=109 then begin cc:=roundunscaled(internal[14]);
g:=poolptr;printint(cc);g:=poolptr-g;
if f>g then begin poolptr:=poolptr-g;while f>g do begin printchar(48);
f:=f-1;end;printint(cc);end;f:=0;
end else if strpool[i]=121 then begin cc:=roundunscaled(internal[13]);
g:=poolptr;printint(cc);g:=poolptr-g;
if f>g then begin poolptr:=poolptr-g;while f>g do begin printchar(48);
f:=f-1;end;printint(cc);end;f:=0;
end else if strpool[i]=72 then begin cc:=roundunscaled(internal[16])div
60;g:=poolptr;printint(cc);g:=poolptr-g;
if f>g then begin poolptr:=poolptr-g;while f>g do begin printchar(48);
f:=f-1;end;printint(cc);end;f:=0;
end else if strpool[i]=77 then begin cc:=roundunscaled(internal[16])mod
60;g:=poolptr;printint(cc);g:=poolptr-g;
if f>g then begin poolptr:=poolptr-g;while f>g do begin printchar(48);
f:=f-1;end;printint(cc);end;f:=0;
end else if strpool[i]=99 then begin if c<0 then print(1164)else begin g
:=poolptr;printint(c);g:=poolptr-g;if f>g then begin poolptr:=poolptr-g;
while f>g do begin printchar(48);f:=f-1;end;printint(c);end;f:=0;end;
end else if(strpool[i]>=48)and(strpool[i]<=57)then begin if(f<10)then f
:=(f*10)+strpool[i]-48;goto 22;
end else print(strpool[i])end end else begin if strpool[i]=46 then if n=
287 then n:=makestring;print(strpool[i]);end;i:=i+1;end;s:=makestring;
selector:=oldsetting;if n=287 then begin n:=s;s:=287;end;
packfilename(n,287,s);
while not aopenout(psfile)do promptfilename(1163,s);
begin if strref[n]<127 then if strref[n]>1 then strref[n]:=strref[n]-1
else flushstring(n);end;end;
begin if strref[s]<127 then if strref[s]>1 then strref[s]:=strref[s]-1
else flushstring(s);end;
{1225:}if(c<firstoutputcode)and(firstoutputcode>=0)then begin
firstoutputcode:=c;
begin if strref[firstfilename]<127 then if strref[firstfilename]>1 then
strref[firstfilename]:=strref[firstfilename]-1 else flushstring(
firstfilename);end;firstfilename:=amakenamestring(psfile);end;
if c>=lastoutputcode then begin lastoutputcode:=c;
begin if strref[lastfilename]<127 then if strref[lastfilename]>1 then
strref[lastfilename]:=strref[lastfilename]-1 else flushstring(
lastfilename);end;lastfilename:=amakenamestring(psfile);end{:1225};
{1228:}if termoffset>maxprintline-6 then println else if(termoffset>0)or
(fileoffset>0)then printchar(32);printchar(91);
if c>=0 then printint(c){:1228};end;
{:1223}{1231:}procedure pspairout(x,y:scaled);
begin if psoffset+26>maxprintline then println;printscaled(x);
printchar(32);printscaled(y);printchar(32)end;
{:1231}{1232:}procedure psprint(s:strnumber);
begin if psoffset+(strstart[nextstr[s]]-strstart[s])>maxprintline then
println;print(s);end;{:1232}{1233:}procedure pspathout(h:halfword);
label 10;var p,q:halfword;d:scaled;curved:boolean;
begin if psoffset+40>maxprintline then println;
if neednewpath then printcmd(1167,1168);neednewpath:=true;
pspairout(mem[h+1].int,mem[h+2].int);printcmd(1169,109);p:=h;
repeat if mem[p].hh.b1=0 then begin if p=h then psprintcmd(1170,1171);
goto 10;end;q:=mem[p].hh.rh;{1235:}curved:=true;
{1236:}if mem[p+5].int=mem[p+1].int then if mem[p+6].int=mem[p+2].int
then if mem[q+3].int=mem[q+1].int then if mem[q+4].int=mem[q+2].int then
curved:=false;d:=mem[q+3].int-mem[p+5].int;
if abs(mem[p+5].int-mem[p+1].int-d)<=131 then if abs(mem[q+1].int-mem[q
+3].int-d)<=131 then begin d:=mem[q+4].int-mem[p+6].int;
if abs(mem[p+6].int-mem[p+2].int-d)<=131 then if abs(mem[q+2].int-mem[q
+4].int-d)<=131 then curved:=false;end{:1236};println;
if curved then begin pspairout(mem[p+5].int,mem[p+6].int);
pspairout(mem[q+3].int,mem[q+4].int);
pspairout(mem[q+1].int,mem[q+2].int);psprintcmd(1174,99);
end else if q<>h then begin pspairout(mem[q+1].int,mem[q+2].int);
psprintcmd(1175,108);end{:1235};p:=q;until p=h;psprintcmd(1172,1173);
10:end;{:1233}{1239:}procedure unknowngraphicsstate(c:scaled);
var p:halfword;k:quarterword;
begin if(c=0)or(c=-1)then begin if gsstate=0 then begin gsstate:=getnode
(10);mem[gsstate+7].hh.rh:=0;
end else begin while mem[gsstate+7].hh.rh<>0 do begin p:=mem[gsstate+7].
hh.rh;freenode(gsstate,10);gsstate:=p;end;end;mem[gsstate+1].int:=c;
mem[gsstate+2].int:=c;mem[gsstate+3].int:=c;mem[gsstate+4].int:=c;
mem[gsstate+5].qqqq.b0:=9;mem[gsstate+5].qqqq.b1:=3;
mem[gsstate+5].qqqq.b2:=3;mem[gsstate+6].int:=0;mem[gsstate+7].hh.lh:=1;
mem[gsstate+8].int:=0;mem[gsstate+9].int:=-1;
end else if c=1 then begin p:=gsstate;gsstate:=getnode(10);
for k:=1 to 9 do mem[gsstate+k]:=mem[p+k];mem[gsstate+7].hh.rh:=p;
end else if c=2 then begin p:=mem[gsstate+7].hh.rh;freenode(gsstate,10);
gsstate:=p;end;end;
{:1239}{1240:}{1247:}function coordrangeOK(h:halfword;zoff:smallnumber;
dz:scaled):boolean;label 40,45,10;var p:halfword;zlo,zhi:scaled;
z:scaled;begin zlo:=mem[h+zoff].int;zhi:=zlo;p:=h;
while mem[p].hh.b1<>0 do begin z:=mem[p+zoff+4].int;
{1248:}if z<zlo then zlo:=z else if z>zhi then zhi:=z;
if zhi-zlo>dz then goto 40{:1248};p:=mem[p].hh.rh;z:=mem[p+zoff+2].int;
{1248:}if z<zlo then zlo:=z else if z>zhi then zhi:=z;
if zhi-zlo>dz then goto 40{:1248};z:=mem[p+zoff].int;
{1248:}if z<zlo then zlo:=z else if z>zhi then zhi:=z;
if zhi-zlo>dz then goto 40{:1248};if p=h then goto 45;end;
45:coordrangeOK:=true;goto 10;40:coordrangeOK:=false;10:end;
{:1247}{1251:}function samedashes(h,hh:halfword):boolean;label 30;
var p,pp:halfword;
begin if h=hh then samedashes:=true else if(h<=1)or(hh<=1)then
samedashes:=false else if mem[h+1].int<>mem[hh+1].int then samedashes:=
false else{1252:}begin p:=mem[h].hh.rh;pp:=mem[hh].hh.rh;
while(p<>2)and(pp<>2)do if(mem[p+1].int<>mem[pp+1].int)or(mem[p+2].int<>
mem[pp+2].int)then goto 30 else begin p:=mem[p].hh.rh;pp:=mem[pp].hh.rh;
end;30:samedashes:=p=pp;end{:1252};end;
{:1251}procedure fixgraphicsstate(p:halfword);var hh,pp:halfword;
wx,wy,ww:scaled;adjwx:boolean;tx,ty:integer;scf:scaled;
begin if(mem[p].hh.b0<4)then{1243:}begin if(mem[p+2].hh.b0=5)or((mem[p+2
].hh.b0=9)and((internal[34]div 65536)=5))then begin if(mem[gsstate+5].
qqqq.b0<>5)or(mem[gsstate+1].int<>mem[p+3].int)or(mem[gsstate+2].int<>
mem[p+4].int)or(mem[gsstate+3].int<>mem[p+5].int)then begin mem[gsstate
+1].int:=mem[p+3].int;mem[gsstate+2].int:=mem[p+4].int;
mem[gsstate+3].int:=mem[p+5].int;mem[gsstate+4].int:=-1;
mem[gsstate+5].qqqq.b0:=5;
begin if psoffset+36>maxprintline then println;printchar(32);
printscaled(mem[gsstate+1].int);printchar(32);
printscaled(mem[gsstate+2].int);printchar(32);
printscaled(mem[gsstate+3].int);printcmd(1182,1183);end;end;
end else if(mem[p+2].hh.b0=7)or((mem[p+2].hh.b0=9)and((internal[34]div
65536)=7))then begin if(mem[gsstate+1].int<>mem[p+3].int)or(mem[gsstate
+2].int<>mem[p+4].int)or(mem[gsstate+3].int<>mem[p+5].int)or(mem[gsstate
+4].int<>mem[p+6].int)or(mem[gsstate+5].qqqq.b0<>7)then begin if mem[p+2
].hh.b0=9 then begin mem[gsstate+1].int:=65536;
mem[gsstate+2].int:=65536;mem[gsstate+3].int:=65536;
mem[gsstate+4].int:=65536;
end else begin mem[gsstate+1].int:=mem[p+3].int;
mem[gsstate+2].int:=mem[p+4].int;mem[gsstate+3].int:=mem[p+5].int;
mem[gsstate+4].int:=mem[p+6].int;end;mem[gsstate+5].qqqq.b0:=7;
begin if psoffset+45>maxprintline then println;printchar(32);
printscaled(mem[gsstate+1].int);printchar(32);
printscaled(mem[gsstate+2].int);printchar(32);
printscaled(mem[gsstate+3].int);printchar(32);
printscaled(mem[gsstate+4].int);printcmd(1184,1185);end;end;
end else if(mem[p+2].hh.b0=3)or((mem[p+2].hh.b0=9)and((internal[34]div
65536)=3))then begin if(mem[gsstate+1].int<>mem[p+3].int)or(mem[gsstate
+5].qqqq.b0<>3)then begin mem[gsstate+1].int:=mem[p+3].int;
mem[gsstate+2].int:=-1;mem[gsstate+3].int:=-1;mem[gsstate+4].int:=-1;
mem[gsstate+5].qqqq.b0:=3;
begin if psoffset+16>maxprintline then println;printchar(32);
printscaled(mem[gsstate+1].int);printcmd(1186,1187);end;end;end;
if mem[p+2].hh.b0=1 then mem[gsstate+5].qqqq.b0:=1;end{:1243};
if(mem[p].hh.b0=1)or(mem[p].hh.b0=2)then if mem[p+1].hh.lh<>0 then if(
mem[p+1].hh.lh=mem[mem[p+1].hh.lh].hh.rh)then begin{1244:}{1245:}pp:=mem
[p+1].hh.lh;
if(mem[pp+5].int=mem[pp+1].int)and(mem[pp+4].int=mem[pp+2].int)then
begin wx:=abs(mem[pp+3].int-mem[pp+1].int);
wy:=abs(mem[pp+6].int-mem[pp+2].int);
end else begin wx:=pythadd(mem[pp+3].int-mem[pp+1].int,mem[pp+5].int-mem
[pp+1].int);
wy:=pythadd(mem[pp+4].int-mem[pp+2].int,mem[pp+6].int-mem[pp+2].int);
end{:1245};{1246:}tx:=1;ty:=1;
if coordrangeOK(mem[p+1].hh.rh,2,wy)then tx:=10 else if coordrangeOK(mem
[p+1].hh.rh,1,wx)then ty:=10;if wy div ty>=wx div tx then begin ww:=wy;
adjwx:=false;end else begin ww:=wx;adjwx:=true;end{:1246};
if(ww<>mem[gsstate+9].int)or(adjwx<>mem[gsstate+5].qqqq.b3)then begin if
adjwx then begin if psoffset+13>maxprintline then println;printchar(32);
printscaled(ww);psprintcmd(1188,1189);
end else begin if internal[36]>0 then begin if psoffset+13>maxprintline
then println;printchar(32);printscaled(ww);psprint(1190);
end else begin if psoffset+15>maxprintline then println;print(1191);
printscaled(ww);psprint(1192);end;end;mem[gsstate+9].int:=ww;
mem[gsstate+5].qqqq.b3:=adjwx;end{:1244};
{1249:}if mem[p].hh.b0=1 then hh:=0 else begin hh:=mem[p+9].hh.rh;
scf:=getpenscale(mem[p+1].hh.lh);
if scf=0 then if mem[gsstate+9].int=0 then scf:=mem[p+10].int else hh:=0
else begin scf:=makescaled(mem[gsstate+9].int,scf);
scf:=takescaled(scf,mem[p+10].int);end;end;
if hh=0 then begin if mem[gsstate+7].hh.lh<>0 then begin psprintcmd(1193
,1194);mem[gsstate+7].hh.lh:=0;end;
end else if(mem[gsstate+8].int<>scf)or not samedashes(mem[gsstate+7].hh.
lh,hh)then{1250:}begin mem[gsstate+7].hh.lh:=hh;mem[gsstate+8].int:=scf;
if(mem[hh+1].int=0)or(abs(mem[hh+1].int)div 65536>=2147483647 div scf)
then psprintcmd(1193,1194)else begin pp:=mem[hh].hh.rh;
mem[3].int:=mem[pp+1].int+mem[hh+1].int;
if psoffset+28>maxprintline then println;print(1195);
while pp<>2 do begin pspairout(takescaled(mem[pp+2].int-mem[pp+1].int,
scf),takescaled(mem[mem[pp].hh.rh+1].int-mem[pp+2].int,scf));
pp:=mem[pp].hh.rh;end;if psoffset+22>maxprintline then println;
print(1196);printscaled(takescaled(dashoffset(hh),scf));
printcmd(1197,1198);end;end{:1250}{:1249};
{1241:}if mem[p].hh.b0=2 then if(mem[mem[p+1].hh.rh].hh.b0=0)or(mem[p+9]
.hh.rh<>0)then if mem[gsstate+5].qqqq.b2<>mem[p+9].hh.b0 then begin if
psoffset+13>maxprintline then println;printchar(32);
printchar(48+mem[p+9].hh.b0);printcmd(1176,1177);
mem[gsstate+5].qqqq.b2:=mem[p+9].hh.b0;end{:1241};
{1242:}if mem[gsstate+5].qqqq.b1<>mem[p].hh.b1 then begin if psoffset+14
>maxprintline then println;printchar(32);printchar(48+mem[p].hh.b1);
printcmd(1178,1179);mem[gsstate+5].qqqq.b1:=mem[p].hh.b1;end;
if mem[gsstate+6].int<>mem[p+7].int then begin if psoffset+27>
maxprintline then println;printchar(32);printscaled(mem[p+7].int);
printcmd(1180,1181);mem[gsstate+6].int:=mem[p+7].int;end{:1242};end;
if psoffset>0 then println;end;
{:1240}{1253:}procedure strokeellipse(h:halfword;fillalso:boolean);
var txx,txy,tyx,tyy:scaled;p:halfword;d1,det:scaled;s:integer;
transformed:boolean;begin transformed:=false;{1254:}p:=mem[h+1].hh.lh;
txx:=mem[p+3].int;tyx:=mem[p+4].int;txy:=mem[p+5].int;tyy:=mem[p+6].int;
if(mem[p+1].int<>0)or(mem[p+2].int<>0)then begin println;
printcmd(1206,1207);pspairout(mem[p+1].int,mem[p+2].int);psprint(1208);
txx:=txx-mem[p+1].int;tyx:=tyx-mem[p+2].int;txy:=txy-mem[p+1].int;
tyy:=tyy-mem[p+2].int;transformed:=true;end else printnl(287);
{1255:}if mem[gsstate+9].int<>65536 then if mem[gsstate+9].int=0 then
begin txx:=65536;tyy:=65536;
end else begin txx:=makescaled(txx,mem[gsstate+9].int);
txy:=makescaled(txy,mem[gsstate+9].int);
tyx:=makescaled(tyx,mem[gsstate+9].int);
tyy:=makescaled(tyy,mem[gsstate+9].int);end;
if(txy<>0)or(tyx<>0)or(txx<>65536)or(tyy<>65536)then if(not transformed)
then begin psprintcmd(1206,1207);transformed:=true;end{:1255}{:1254};
{1257:}det:=takescaled(txx,tyy)-takescaled(txy,tyx);d1:=4*10+1;
if abs(det)<d1 then begin if det>=0 then begin d1:=d1-det;s:=1;
end else begin d1:=-d1-det;s:=-1;end;d1:=d1*65536;
if abs(txx)+abs(tyy)>=abs(txy)+abs(tyy)then if abs(txx)>abs(tyy)then tyy
:=tyy+(d1+s*abs(txx))div txx else txx:=txx+(d1+s*abs(tyy))div tyy else
if abs(txy)>abs(tyx)then tyx:=tyx+(d1+s*abs(txy))div txy else txy:=txy+(
d1+s*abs(tyx))div tyx;end{:1257};pspathout(mem[h+1].hh.rh);
if internal[36]=0 then begin if fillalso then printnl(1199);
{1256:}if(txy<>0)or(tyx<>0)then begin println;printchar(91);
pspairout(txx,tyx);pspairout(txy,tyy);psprint(1209);
end else if(txx<>65536)or(tyy<>65536)then begin println;
pspairout(txx,tyy);print(1210);end{:1256};psprint(1200);
if transformed then psprint(1201);
end else begin if fillalso then printnl(66)else println;
if(txy<>0)or(tyx<>0)then begin print(1195);pspairout(txx,tyx);
pspairout(txy,tyy);psprint(1202);
end else if(txx<>65536)or(tyy<>65536)then begin pspairout(txx,tyy);
print(1203);end;psprint(1204);if transformed then psprint(1205);end;
println;end;{:1253}{1258:}procedure psfillout(p:halfword);
begin pspathout(p);psprintcmd(1211,1212);println;end;
{:1258}{1259:}procedure doouterenvelope(p,h:halfword);
begin p:=makeenvelope(p,mem[h+1].hh.lh,mem[h].hh.b1,0,mem[h+7].int);
psfillout(p);tossknotlist(p);end;
{:1259}{1260:}function choosescale(p:halfword):scaled;
var a,b,c,d,ad,bc:scaled;begin a:=mem[p+13].int;b:=mem[p+14].int;
c:=mem[p+15].int;d:=mem[p+16].int;if(a<0)then a:=-a;if(b<0)then b:=-b;
if(c<0)then c:=-c;if(d<0)then d:=-d;ad:=(a-d)div 2;bc:=(b-c)div 2;
choosescale:=pythadd(pythadd(d+ad,ad),pythadd(c+bc,bc));end;
{:1260}{1261:}procedure psstringout(s:strnumber);var i:poolpointer;
k:ASCIIcode;begin print(40);i:=strstart[s];
while i<strstart[nextstr[s]]do begin if psoffset+5>maxprintline then
begin printchar(92);println;end;k:=strpool[i];
if({1344:}(k<=32)or(k>126){:1344})then begin printchar(92);
printchar(48+(k div 64));printchar(48+((k div 8)mod 8));
printchar(48+(k mod 8));
end else begin if(k=40)or(k=41)or(k=92)then printchar(92);printchar(k);
end;i:=i+1;end;print(41);end;
{:1261}{1262:}function ispsname(s:strnumber):boolean;label 45,10;
var i:poolpointer;k:ASCIIcode;begin i:=strstart[s];
while i<strstart[nextstr[s]]do begin k:=strpool[i];
if(k<=32)or(k>126)then goto 45;
if(k=40)or(k=41)or(k=60)or(k=62)or(k=123)or(k=125)or(k=47)or(k=37)then
goto 45;i:=i+1;end;ispsname:=true;goto 10;45:ispsname:=false;10:end;
{:1262}{1263:}procedure psnameout(s:strnumber;lit:boolean);
begin if psoffset+(strstart[nextstr[s]]-strstart[s])+2>maxprintline then
println;printchar(32);
if ispsname(s)then begin if lit then printchar(47);print(s);
end else begin psstringout(s);if not lit then psprint(1213);
psprint(1214);end;end;{:1263}{1265:}procedure unmarkfont(f:fontnumber);
var k:0..fontmemsize;
begin for k:=charbase[f]+fontbc[f]to charbase[f]+fontec[f]do fontinfo[k]
.qqqq.b3:=0;end;{:1265}{1266:}procedure markstringchars(f:fontnumber;
s:strnumber);var b:integer;bc,ec:poolASCIIcode;k:poolpointer;
begin b:=charbase[f];bc:=fontbc[f];ec:=fontec[f];
k:=strstart[nextstr[s]];while k>strstart[s]do begin k:=k-1;
if(strpool[k]>=bc)and(strpool[k]<=ec)then fontinfo[b+strpool[k]].qqqq.b3
:=1;end end;{:1266}{1267:}procedure hexdigitout(d:smallnumber);
begin if d<10 then printchar(d+48)else printchar(d+87);end;
{:1267}{1268:}function psmarksout(f:fontnumber;c:eightbits):halfword;
var bc,ec:eightbits;lim:integer;p:0..fontmemsize;d,b:0..15;
begin lim:=4*(emergencylinelength-psoffset-4);bc:=fontbc[f];
ec:=fontec[f];if c>bc then bc:=c;{1269:}p:=charbase[f]+bc;
while(fontinfo[p].qqqq.b3=0)and(bc<ec)do begin p:=p+1;bc:=bc+1;end;
if ec>=bc+lim then ec:=bc+lim-1;p:=charbase[f]+ec;
while(fontinfo[p].qqqq.b3=0)and(bc<ec)do begin p:=p-1;ec:=ec-1;end;
{:1269};{1270:}printchar(32);hexdigitout(bc div 16);
hexdigitout(bc mod 16);printchar(58){:1270};{1271:}b:=8;d:=0;
for p:=charbase[f]+bc to charbase[f]+ec do begin if b=0 then begin
hexdigitout(d);d:=0;b:=8;end;if fontinfo[p].qqqq.b3<>0 then d:=d+b;
b:=(b)div 2;end;hexdigitout(d){:1271};
while(ec<fontec[f])and(fontinfo[p].qqqq.b3=0)do begin p:=p+1;ec:=ec+1;
end;psmarksout:=ec+1;end;
{:1268}{1272:}function checkpsmarks(f:fontnumber;c:integer):boolean;
label 10;var p:0..fontmemsize;
begin for p:=charbase[f]+c to charbase[f]+fontec[f]do if fontinfo[p].
qqqq.b3=1 then begin checkpsmarks:=true;goto 10;end;checkpsmarks:=false;
10:end;{:1272}{1274:}function sizeindex(f:fontnumber;
s:scaled):quarterword;label 40;var p,q:halfword;i:quarterword;
begin q:=fontsizes[f];i:=0;
while q<>0 do begin if abs(s-mem[q+1].int)<=65 then goto 40 else begin p
:=q;q:=mem[q].hh.rh;i:=i+1;end;if i=255 then overflow(1215,255);end;
q:=getnode(2);mem[q+1].int:=s;
if i=0 then fontsizes[f]:=q else mem[p].hh.rh:=q;40:sizeindex:=i;end;
{:1274}{1275:}function indexedsize(f:fontnumber;j:quarterword):scaled;
var p:halfword;i:quarterword;begin p:=fontsizes[f];i:=0;
if p=0 then confusion(1216);while(i<>j)do begin i:=i+1;p:=mem[p].hh.rh;
if p=0 then confusion(1216);end;indexedsize:=mem[p+1].int;end;
{:1275}{1276:}procedure clearsizes;var f:fontnumber;p:halfword;
begin for f:=1 to lastfnum do while fontsizes[f]<>0 do begin p:=
fontsizes[f];fontsizes[f]:=mem[p].hh.rh;freenode(p,2);end;end;
{:1276}{1283:}procedure shipout(h:halfword);label 30,32,40,42,43;
var p:halfword;q:halfword;t:integer;f,ff:fontnumber;ldf:fontnumber;
donefonts:boolean;nextsize:quarterword;
curfsize:array[fontnumber]of halfword;ds,scf:scaled;transformed:boolean;
begin openoutputfile;nonpssetting:=selector;selector:=5;
if(internal[32]=131072)or(internal[32]=196608)then begin{1290:}print(
1275);printnl(1276);setbbox(h,true);
if mem[h+2].int>mem[h+4].int then print(1277)else begin pspairout(
floorscaled(mem[h+2].int),floorscaled(mem[h+3].int));
pspairout(-floorscaled(-mem[h+4].int),-floorscaled(-mem[h+5].int));end;
printnl(1278);
if mem[h+2].int>mem[h+4].int then print(1277)else begin pspairout(mem[h
+2].int,mem[h+3].int);pspairout(mem[h+4].int,mem[h+5].int);end;
printnl(1279);print(256);printnl(1280);
printint(roundunscaled(internal[13]));printchar(46);
printdd(roundunscaled(internal[14]));printchar(46);
printdd(roundunscaled(internal[15]));printchar(58);
t:=roundunscaled(internal[16]);printdd(t div 60);printdd(t mod 60);
printnl(1281);{:1290};
{1293:}for f:=1 to lastfnum do begin if fontsizes[f]<>0 then begin
unmarkfont(f);fontsizes[f]:=0;end;
if fontencname[f]<>0 then begin if strref[fontencname[f]]<127 then if
strref[fontencname[f]]>1 then strref[fontencname[f]]:=strref[fontencname
[f]]-1 else flushstring(fontencname[f]);end;fontencname[f]:=0;end;
for f:=1 to lastfnum do begin p:=mem[h+7].hh.rh;
while p<>0 do begin if mem[p].hh.b0=3 then if mem[p+1].hh.lh<>0 then
begin fontsizes[mem[p+1].hh.lh]:=1;
markstringchars(mem[p+1].hh.lh,mem[p+1].hh.rh);
if hasfmentry(mem[p+1].hh.lh)then fontpsname[mem[p+1].hh.lh]:=fmfontname
(mem[p+1].hh.lh);end;p:=mem[p].hh.rh;end;end{:1293};
mploadencodings(lastfnum);
{1294:}for f:=1 to lastfnum do begin p:=mem[h+7].hh.rh;
while p<>0 do begin if mem[p].hh.b0=3 then if mem[p+1].hh.lh<>0 then if
hasfmentry(mem[p+1].hh.lh)then if fontencname[mem[p+1].hh.lh]=0 then
fontencname[mem[p+1].hh.lh]:=fmencodingname(mem[p+1].hh.lh);
p:=mem[p].hh.rh;end;end{:1294};{1285:}begin listusedresources;
listsuppliedresources;listneededresources;printnl(1238);printnl(1221);
if internal[36]>0 then printnl(1239)else printnl(1240);printnl(1241);
if internal[36]>0 then{1284:}begin printnl(1225);printnl(1226);
printnl(1227);printnl(1228);printnl(1229);printnl(1230);end{:1284};
printnl(1242);printnl(1243);printnl(1244);
if internal[37]>0 then begin printnl(1245);end;printnl(1246);
printnl(1247);{1292:}mpfontencodings(lastfnum,(internal[32]=131072));
{1295:}begin nextsize:=0;
{1298:}for f:=1 to lastfnum do curfsize[f]:=fontsizes[f]{:1298};
repeat donefonts:=true;
for f:=1 to lastfnum do begin if curfsize[f]<>0 then begin if internal[
32]=196608 then if not dopsfont(f)then if hasfmentry(f)then begin begin
if interaction=3 then;printnl(263);print(1282);end;error;end;
curfsize[f]:=mem[curfsize[f]].hh.rh;
if curfsize[f]<>0 then begin unmarkfont(f);donefonts:=false;end end;end;
if not donefonts then{1302:}begin nextsize:=nextsize+1;
p:=mem[h+7].hh.rh;
while p<>0 do begin if mem[p].hh.b0=3 then if mem[p+1].hh.lh<>0 then if
mem[p].hh.b1=nextsize then markstringchars(mem[p+1].hh.lh,mem[p+1].hh.rh
);p:=mem[p].hh.rh;end;end{:1302};until donefonts;end{:1295}{:1292};
printnl(1222);printnl(1248);println;
for f:=1 to lastfnum do begin if fontsizes[f]<>0 then begin if
hasfmentry(f)then begin{1286:}if(((fontisreencoded(f))and((not
fontissubsetted(f))or(internal[32]=131072))))or(fmfontslant(f)<>0)or(
fmfontextend(f)<>0)or(strvsstr(fontname[f],1232)=0)or(strvsstr(fontname[
f],1234)=0)then begin if(fontissubsetted(f))and(fontisincluded(f))and(
internal[32]=196608)then psnameout(fmfontsubsetname(f),true)else
psnameout(fontpsname[f],true);psprint(1253);println;
if((fontisreencoded(f))and((not fontissubsetted(f))or(internal[32]=
131072)))then begin psprint(1254);psprint(fontencname[f]);psprint(1255);
end;if fmfontslant(f)<>0 then begin printint(fmfontslant(f));
psprint(1256);end;
if fmfontextend(f)<>0 then begin printint(fmfontextend(f));
psprint(1257);end;
if strvsstr(fontname[f],1232)=0 then begin psprint(1258);psprint(1259);
end;if strvsstr(fontname[f],1234)=0 then begin psprint(1260);
psprint(1261);psprint(1262);psprint(1263);psprint(1264);end;
psprint(1265);println;psprint(1231);
if(fontissubsetted(f))and(fontisincluded(f))and(internal[32]=196608)then
print(fmfontsubsetname(f))else print(fontpsname[f]);
if strvsstr(fontname[f],1232)=0 then begin psprint(1233);end;
if strvsstr(fontname[f],1234)=0 then begin psprint(1235);end;
if((fontisreencoded(f))and((not fontissubsetted(f))or(internal[32]=
131072)))then begin psprint(45);psprint(fontencname[f]);end;
if fmfontslant(f)<>0 then begin psprint(1236);
printint(fmfontslant(f))end;
if fmfontextend(f)<>0 then begin psprint(1237);
printint(fmfontextend(f))end;psprint(1266);println;end{:1286};
psnameout(fontname[f],true);psprint(1231);
if(fontissubsetted(f))and(fontisincluded(f))and(internal[32]=196608)then
print(fmfontsubsetname(f))else print(fontpsname[f]);
if strvsstr(fontname[f],1232)=0 then begin psprint(1233);end;
if strvsstr(fontname[f],1234)=0 then begin psprint(1235);end;
if((fontisreencoded(f))and((not fontissubsetted(f))or(internal[32]=
131072)))then begin psprint(45);psprint(fontencname[f]);end;
if fmfontslant(f)<>0 then begin psprint(1236);
printint(fmfontslant(f))end;
if fmfontextend(f)<>0 then begin psprint(1237);
printint(fmfontextend(f))end;psprint(1249);
end else begin begindiagnostic;begin if interaction=3 then;printnl(263);
print(1250);end;print(fontname[f]);print(1251);enddiagnostic(true);
psnameout(fontname[f],true);psnameout(fontname[f],true);psprint(1249);
end;println;end;end;printnl(1252);printnl(1223);println;end{:1285};
{1282:}t:=mem[29997].hh.rh;
while t<>0 do begin if(strstart[nextstr[mem[t+1].int]]-strstart[mem[t+1]
.int])<=emergencylinelength then print(mem[t+1].int)else overflow(1218,
emergencylinelength);println;t:=mem[t].hh.rh;end;
flushtokenlist(mem[29997].hh.rh);mem[29997].hh.rh:=0;
lastpending:=29997{:1282};unknowngraphicsstate(0);neednewpath:=true;
p:=mem[h+7].hh.rh;
while p<>0 do begin if(mem[p].hh.b0<4)then if(mem[p+8].hh.lh)<>0 then
begin printnl(mem[p+8].hh.lh);println;end;fixgraphicsstate(p);
case mem[p].hh.b0 of{1304:}4:begin printnl(287);printcmd(1206,1207);
pspathout(mem[p+1].hh.rh);psprintcmd(1290,1291);println;
if internal[35]>0 then unknowngraphicsstate(1);end;6:begin printnl(287);
printcmd(1292,81);println;
if internal[35]>0 then unknowngraphicsstate(2)else unknowngraphicsstate(
-1);end;
{:1304}{1305:}1:begin if mem[p+1].hh.lh=0 then psfillout(mem[p+1].hh.rh)
else if(mem[p+1].hh.lh=mem[mem[p+1].hh.lh].hh.rh)then strokeellipse(p,
true)else begin doouterenvelope(copypath(mem[p+1].hh.rh),p);
doouterenvelope(htapypoc(mem[p+1].hh.rh),p);end;
if(mem[p+8].hh.rh)<>0 then begin printnl(mem[p+8].hh.rh);println;end;
end;
2:begin if(mem[p+1].hh.lh=mem[mem[p+1].hh.lh].hh.rh)then strokeellipse(p
,false)else begin q:=copypath(mem[p+1].hh.rh);t:=mem[p+9].hh.b0;
{1306:}if mem[q].hh.b0<>0 then begin mem[insertknot(q,mem[q+1].int,mem[q
+2].int)].hh.b0:=0;mem[q].hh.b1:=0;q:=mem[q].hh.rh;t:=1;end{:1306};
q:=makeenvelope(q,mem[p+1].hh.lh,mem[p].hh.b1,t,mem[p+7].int);
psfillout(q);tossknotlist(q);end;
if(mem[p+8].hh.rh)<>0 then begin printnl(mem[p+8].hh.rh);println;end;
end;
{:1305}{1307:}3:begin if(mem[p+1].hh.lh<>0)and((strstart[nextstr[mem[p+1
].hh.rh]]-strstart[mem[p+1].hh.rh])>0)then begin if internal[32]>0 then
scf:=choosescale(p)else scf:=indexedsize(mem[p+1].hh.lh,mem[p].hh.b1);
{1309:}transformed:=(mem[p+13].int<>scf)or(mem[p+16].int<>scf)or(mem[p
+14].int<>0)or(mem[p+15].int<>0);
if transformed then begin printcmd(1294,1295);
pspairout(makescaled(mem[p+13].int,scf),makescaled(mem[p+15].int,scf));
pspairout(makescaled(mem[p+14].int,scf),makescaled(mem[p+16].int,scf));
pspairout(mem[p+11].int,mem[p+12].int);psprintcmd(1296,1297);
end else begin pspairout(mem[p+11].int,mem[p+12].int);
psprintcmd(1169,109);end;println{:1309};psstringout(mem[p+1].hh.rh);
psnameout(fontname[mem[p+1].hh.lh],false);
{1308:}if psoffset+18>maxprintline then println;printchar(32);
ds:=(fontdsize[mem[p+1].hh.lh]+8)div 16;printscaled(takescaled(ds,scf));
print(1293);if transformed then psprintcmd(1201,1205){:1308};println;
end;if(mem[p+8].hh.rh)<>0 then begin printnl(mem[p+8].hh.rh);println;
end;end;{:1307}5,7:;end;p:=mem[p].hh.rh;end;printcmd(1219,80);println;
print(1220);println;aclose(psfile);selector:=nonpssetting;
if internal[32]<=0 then clearsizes;{1229:}printchar(93);break(termout);
totalshipped:=totalshipped+1{:1229};end else begin{1296:}print(1283);
if internal[32]>0 then print(1284);printnl(1276);setbbox(h,true);
if mem[h+2].int>mem[h+4].int then print(1277)else if internal[32]<0 then
begin pspairout(mem[h+2].int,mem[h+3].int);
pspairout(mem[h+4].int,mem[h+5].int);
end else begin pspairout(floorscaled(mem[h+2].int),floorscaled(mem[h+3].
int));
pspairout(-floorscaled(-mem[h+4].int),-floorscaled(-mem[h+5].int));end;
printnl(1278);
if mem[h+2].int>mem[h+4].int then print(1277)else begin pspairout(mem[h
+2].int,mem[h+3].int);pspairout(mem[h+4].int,mem[h+5].int);end;
printnl(1279);print(256);printnl(1280);
printint(roundunscaled(internal[13]));printchar(46);
printdd(roundunscaled(internal[14]));printchar(46);
printdd(roundunscaled(internal[15]));printchar(58);
t:=roundunscaled(internal[16]);printdd(t div 60);printdd(t mod 60);
printnl(1281);{1297:}{1300:}for f:=1 to lastfnum do fontsizes[f]:=0;
p:=mem[h+7].hh.rh;
while p<>0 do begin if mem[p].hh.b0=3 then if mem[p+1].hh.lh<>0 then
begin f:=mem[p+1].hh.lh;
if internal[32]>0 then fontsizes[f]:=1 else begin if fontsizes[f]=0 then
unmarkfont(f);mem[p].hh.b1:=sizeindex(f,choosescale(p));
if mem[p].hh.b1=0 then markstringchars(f,mem[p+1].hh.rh);end;end;
p:=mem[p].hh.rh;end{:1300};if internal[32]>0 then{1299:}begin ldf:=0;
for f:=1 to lastfnum do if fontsizes[f]<>0 then begin if ldf=0 then
printnl(1285);
for ff:=ldf downto 0 do if fontsizes[ff]<>0 then if strvsstr(fontpsname[
f],fontpsname[ff])=0 then goto 40;
if psoffset+1+(strstart[nextstr[fontpsname[f]]]-strstart[fontpsname[f]])
>maxprintline then printnl(1286);printchar(32);print(fontpsname[f]);
ldf:=f;40:end;end{:1299}else begin nextsize:=0;
{1298:}for f:=1 to lastfnum do curfsize[f]:=fontsizes[f]{:1298};
repeat donefonts:=true;
for f:=1 to lastfnum do begin if curfsize[f]<>0 then{1301:}begin t:=0;
while checkpsmarks(f,t)do begin printnl(1287);
if psoffset+(strstart[nextstr[fontname[f]]]-strstart[fontname[f]])+12>
emergencylinelength then goto 30;print(fontname[f]);printchar(32);
ds:=(fontdsize[f]+8)div 16;
printscaled(takescaled(ds,mem[curfsize[f]+1].int));
if psoffset+12>emergencylinelength then goto 30;printchar(32);
printscaled(ds);if psoffset+5>emergencylinelength then goto 30;
t:=psmarksout(f,t);end;30:curfsize[f]:=mem[curfsize[f]].hh.rh;
end{:1301};if curfsize[f]<>0 then begin unmarkfont(f);donefonts:=false;
end;end;if not donefonts then{1302:}begin nextsize:=nextsize+1;
p:=mem[h+7].hh.rh;
while p<>0 do begin if mem[p].hh.b0=3 then if mem[p+1].hh.lh<>0 then if
mem[p].hh.b1=nextsize then markstringchars(mem[p+1].hh.lh,mem[p+1].hh.rh
);p:=mem[p].hh.rh;end;end{:1302};until donefonts;end{:1297};
println{:1296};
if(internal[32]>0)and(lastpsfnum<lastfnum)then readpsnametable;
print(1221);println;
if(internal[32]>0)or(internal[36]>0)then{1303:}begin if ldf<>0 then
begin if internal[32]>0 then begin for f:=1 to lastfnum do if fontsizes[
f]<>0 then begin psnameout(fontname[f],true);
psnameout(fontpsname[f],true);psprint(1249);println;end;
if internal[36]=0 then begin print(1288);println;end;end;end;
if internal[36]>0 then begin if(internal[32]>0)and(ldf<>0)then print(
1241)else printnl(1289);{1284:}begin printnl(1225);printnl(1226);
printnl(1227);printnl(1228);printnl(1229);printnl(1230);end{:1284};
println;end;end{:1303};print(1222);printnl(1223);println;
{1282:}t:=mem[29997].hh.rh;
while t<>0 do begin if(strstart[nextstr[mem[t+1].int]]-strstart[mem[t+1]
.int])<=emergencylinelength then print(mem[t+1].int)else overflow(1218,
emergencylinelength);println;t:=mem[t].hh.rh;end;
flushtokenlist(mem[29997].hh.rh);mem[29997].hh.rh:=0;
lastpending:=29997{:1282};unknowngraphicsstate(0);neednewpath:=true;
p:=mem[h+7].hh.rh;
while p<>0 do begin if(mem[p].hh.b0<4)then if(mem[p+8].hh.lh)<>0 then
begin printnl(mem[p+8].hh.lh);println;end;fixgraphicsstate(p);
case mem[p].hh.b0 of{1304:}4:begin printnl(287);printcmd(1206,1207);
pspathout(mem[p+1].hh.rh);psprintcmd(1290,1291);println;
if internal[35]>0 then unknowngraphicsstate(1);end;6:begin printnl(287);
printcmd(1292,81);println;
if internal[35]>0 then unknowngraphicsstate(2)else unknowngraphicsstate(
-1);end;
{:1304}{1305:}1:begin if mem[p+1].hh.lh=0 then psfillout(mem[p+1].hh.rh)
else if(mem[p+1].hh.lh=mem[mem[p+1].hh.lh].hh.rh)then strokeellipse(p,
true)else begin doouterenvelope(copypath(mem[p+1].hh.rh),p);
doouterenvelope(htapypoc(mem[p+1].hh.rh),p);end;
if(mem[p+8].hh.rh)<>0 then begin printnl(mem[p+8].hh.rh);println;end;
end;
2:begin if(mem[p+1].hh.lh=mem[mem[p+1].hh.lh].hh.rh)then strokeellipse(p
,false)else begin q:=copypath(mem[p+1].hh.rh);t:=mem[p+9].hh.b0;
{1306:}if mem[q].hh.b0<>0 then begin mem[insertknot(q,mem[q+1].int,mem[q
+2].int)].hh.b0:=0;mem[q].hh.b1:=0;q:=mem[q].hh.rh;t:=1;end{:1306};
q:=makeenvelope(q,mem[p+1].hh.lh,mem[p].hh.b1,t,mem[p+7].int);
psfillout(q);tossknotlist(q);end;
if(mem[p+8].hh.rh)<>0 then begin printnl(mem[p+8].hh.rh);println;end;
end;
{:1305}{1307:}3:begin if(mem[p+1].hh.lh<>0)and((strstart[nextstr[mem[p+1
].hh.rh]]-strstart[mem[p+1].hh.rh])>0)then begin if internal[32]>0 then
scf:=choosescale(p)else scf:=indexedsize(mem[p+1].hh.lh,mem[p].hh.b1);
{1309:}transformed:=(mem[p+13].int<>scf)or(mem[p+16].int<>scf)or(mem[p
+14].int<>0)or(mem[p+15].int<>0);
if transformed then begin printcmd(1294,1295);
pspairout(makescaled(mem[p+13].int,scf),makescaled(mem[p+15].int,scf));
pspairout(makescaled(mem[p+14].int,scf),makescaled(mem[p+16].int,scf));
pspairout(mem[p+11].int,mem[p+12].int);psprintcmd(1296,1297);
end else begin pspairout(mem[p+11].int,mem[p+12].int);
psprintcmd(1169,109);end;println{:1309};psstringout(mem[p+1].hh.rh);
psnameout(fontname[mem[p+1].hh.lh],false);
{1308:}if psoffset+18>maxprintline then println;printchar(32);
ds:=(fontdsize[mem[p+1].hh.lh]+8)div 16;printscaled(takescaled(ds,scf));
print(1293);if transformed then psprintcmd(1201,1205){:1308};println;
end;if(mem[p+8].hh.rh)<>0 then begin printnl(mem[p+8].hh.rh);println;
end;end;{:1307}5,7:;end;p:=mem[p].hh.rh;end;printcmd(1219,80);println;
print(1220);println;aclose(psfile);selector:=nonpssetting;
if internal[32]<=0 then clearsizes;{1229:}printchar(93);break(termout);
totalshipped:=totalshipped+1{:1229};end;
if internal[9]>0 then printedges(h,1224,true);end;
{:1283}procedure doshipout;var c:integer;begin getxnext;scanexpression;
if curtype<>10 then{1113:}begin disperr(0,1074);begin helpptr:=1;
helpline[0]:=1075;end;putgetflusherror(0);
end{:1113}else begin c:=roundunscaled(internal[17])mod 256;
if c<0 then c:=c+256;{1144:}if c<bc then bc:=c;if c>ec then ec:=c;
charexists[c]:=true;tfmwidth[c]:=tfmcheck(19);
tfmheight[c]:=tfmcheck(20);tfmdepth[c]:=tfmcheck(21);
tfmitalcorr[c]:=tfmcheck(22){:1144};shipout(curexp);flushcurexp(0);end;
end;{:1112}{1120:}{1121:}procedure nostringerr(s:strnumber);
begin disperr(0,765);begin helpptr:=1;helpline[0]:=s;end;putgeterror;
end;{:1121}procedure domessage;var m:0..2;begin m:=curmod;getxnext;
scanexpression;
if curtype<>4 then nostringerr(1080)else case m of 0:begin printnl(287);
print(curexp);end;1:{1125:}begin begin if interaction=3 then;
printnl(263);print(287);end;print(curexp);
if errhelp<>0 then useerrhelp:=true else if longhelpseen then begin
helpptr:=1;helpline[0]:=1081;
end else begin if interaction<3 then longhelpseen:=true;
begin helpptr:=4;helpline[3]:=1082;helpline[2]:=1083;helpline[1]:=1084;
helpline[0]:=1085;end;end;putgeterror;useerrhelp:=false;end{:1125};
2:{1122:}begin if errhelp<>0 then begin if strref[errhelp]<127 then if
strref[errhelp]>1 then strref[errhelp]:=strref[errhelp]-1 else
flushstring(errhelp);end;
if(strstart[nextstr[curexp]]-strstart[curexp])=0 then errhelp:=0 else
begin errhelp:=curexp;
begin if strref[errhelp]<127 then strref[errhelp]:=strref[errhelp]+1;
end;end;end{:1122};
3:{1345:}begin if filenametemplate<>0 then begin if strref[
filenametemplate]<127 then if strref[filenametemplate]>1 then strref[
filenametemplate]:=strref[filenametemplate]-1 else flushstring(
filenametemplate);end;
if(strstart[nextstr[curexp]]-strstart[curexp])=0 then filenametemplate:=
0 else begin filenametemplate:=curexp;
begin if strref[filenametemplate]<127 then strref[filenametemplate]:=
strref[filenametemplate]+1;end;end;end{:1345};end;flushcurexp(0);end;
{:1120}{1127:}procedure dowrite;label 22;var t:strnumber;
n,n0:writeindex;oldsetting:0..10;begin getxnext;scanexpression;
if curtype<>4 then nostringerr(1086)else if curcmd<>71 then begin begin
if interaction=3 then;printnl(263);print(1087);end;begin helpptr:=1;
helpline[0]:=1088;end;putgeterror;end else begin t:=curexp;curtype:=1;
getxnext;scanexpression;
if curtype<>4 then nostringerr(1089)else{1128:}begin{1129:}n:=writefiles
;n0:=writefiles;
repeat 22:if n=0 then{1130:}begin if n0=writefiles then if writefiles<4
then writefiles:=writefiles+1 else overflow(1090,4);n:=n0;
openwritefile(curexp,n);end{:1130}else begin n:=n-1;
if wrfname[n]=0 then begin n0:=n;goto 22;end;end;
until strvsstr(curexp,wrfname[n])=0{:1129};
{934:}if eofline=0 then begin begin strpool[poolptr]:=0;
poolptr:=poolptr+1;end;eofline:=makestring;strref[eofline]:=127;
end{:934};if strvsstr(t,eofline)=0 then{1131:}begin aclose(wrfile[n]);
begin if strref[wrfname[n]]<127 then if strref[wrfname[n]]>1 then strref
[wrfname[n]]:=strref[wrfname[n]]-1 else flushstring(wrfname[n]);end;
wrfname[n]:=0;if n=writefiles-1 then writefiles:=n;
end{:1131}else begin oldsetting:=selector;selector:=n;print(t);println;
selector:=oldsetting;end;end{:1128};
begin if strref[t]<127 then if strref[t]>1 then strref[t]:=strref[t]-1
else flushstring(t);end;end;flushcurexp(0);end;
{:1127}{1148:}function getcode:eightbits;label 40;var c:integer;
begin getxnext;scanexpression;
if curtype=17 then begin c:=roundunscaled(curexp);
if c>=0 then if c<256 then goto 40;
end else if curtype=4 then if(strstart[nextstr[curexp]]-strstart[curexp]
)=1 then begin c:=strpool[strstart[curexp]];goto 40;end;disperr(0,1099);
begin helpptr:=2;helpline[1]:=1100;helpline[0]:=1101;end;
putgetflusherror(0);c:=0;40:getcode:=c;end;
{:1148}{1149:}procedure settag(c:halfword;t:smallnumber;r:halfword);
begin if chartag[c]=0 then begin chartag[c]:=t;charremainder[c]:=r;
if t=1 then begin labelptr:=labelptr+1;labelloc[labelptr]:=r;
labelchar[labelptr]:=c;end;
end else{1150:}begin begin if interaction=3 then;printnl(263);
print(1102);end;
if(c>32)and(c<127)then print(c)else if c=256 then print(1103)else begin
print(1104);printint(c);end;print(1105);case chartag[c]of 1:print(1106);
2:print(1107);3:print(1096);end;begin helpptr:=2;helpline[1]:=1108;
helpline[0]:=1061;end;putgeterror;end{:1150};end;
{:1149}{1151:}procedure dotfmcommand;label 22,30;var c,cc:0..256;
k:0..maxkerns;j:integer;begin case curmod of 0:begin c:=getcode;
while curcmd=80 do begin cc:=getcode;settag(c,2,cc);c:=cc;end;end;
1:{1152:}begin lkstarted:=false;22:getxnext;
if(curcmd=77)and lkstarted then{1155:}begin c:=getcode;
if nl-skiptable[c]>128 then begin begin begin if interaction=3 then;
printnl(263);print(1125);end;begin helpptr:=1;helpline[0]:=1126;end;
error;ll:=skiptable[c];repeat lll:=ligkern[ll].b0-0;ligkern[ll].b0:=128;
ll:=ll-lll;until lll=0;end;skiptable[c]:=ligtablesize;end;
if skiptable[c]=ligtablesize then ligkern[nl-1].b0:=0 else ligkern[nl-1]
.b0:=nl-skiptable[c]-1;skiptable[c]:=nl-1;goto 30;end{:1155};
if curcmd=78 then begin c:=256;curcmd:=80;end else begin backinput;
c:=getcode;end;
if(curcmd=80)or(curcmd=79)then{1156:}begin if curcmd=80 then if c=256
then bchlabel:=nl else settag(c,1,nl)else if skiptable[c]<ligtablesize
then begin ll:=skiptable[c];skiptable[c]:=ligtablesize;
repeat lll:=ligkern[ll].b0-0;
if nl-ll>128 then begin begin begin if interaction=3 then;printnl(263);
print(1125);end;begin helpptr:=1;helpline[0]:=1126;end;error;ll:=ll;
repeat lll:=ligkern[ll].b0-0;ligkern[ll].b0:=128;ll:=ll-lll;until lll=0;
end;goto 22;end;ligkern[ll].b0:=nl-ll-1;ll:=ll-lll;until lll=0;end;
goto 22;end{:1156};if curcmd=75 then{1157:}begin ligkern[nl].b1:=c+0;
ligkern[nl].b0:=0;if curmod<128 then begin ligkern[nl].b2:=curmod+0;
ligkern[nl].b3:=getcode+0;end else begin getxnext;scanexpression;
if curtype<>17 then begin disperr(0,1127);begin helpptr:=2;
helpline[1]:=1128;helpline[0]:=311;end;putgetflusherror(0);end;
kern[nk]:=curexp;k:=0;while kern[k]<>curexp do k:=k+1;
if k=nk then begin if nk=maxkerns then overflow(1124,maxkerns);nk:=nk+1;
end;ligkern[nl].b2:=128+(k div 256);ligkern[nl].b3:=(k mod 256)+0;end;
lkstarted:=true;end{:1157}else begin begin if interaction=3 then;
printnl(263);print(1113);end;begin helpptr:=1;helpline[0]:=1114;end;
backerror;ligkern[nl].b1:=0;ligkern[nl].b2:=0;ligkern[nl].b3:=0;
ligkern[nl].b0:=129;end;
if nl=ligtablesize then overflow(1115,ligtablesize);nl:=nl+1;
if curcmd=81 then goto 22;
if ligkern[nl-1].b0<128 then ligkern[nl-1].b0:=128;30:end{:1152};
2:{1158:}begin if ne=256 then overflow(1096,256);c:=getcode;
settag(c,3,ne);if curcmd<>80 then begin missingerr(58);begin helpptr:=1;
helpline[0]:=1129;end;backerror;end;exten[ne].b0:=getcode+0;
if curcmd<>81 then begin missingerr(44);begin helpptr:=1;
helpline[0]:=1129;end;backerror;end;exten[ne].b1:=getcode+0;
if curcmd<>81 then begin missingerr(44);begin helpptr:=1;
helpline[0]:=1129;end;backerror;end;exten[ne].b2:=getcode+0;
if curcmd<>81 then begin missingerr(44);begin helpptr:=1;
helpline[0]:=1129;end;backerror;end;exten[ne].b3:=getcode+0;ne:=ne+1;
end{:1158};3,4:begin c:=curmod;getxnext;scanexpression;
if(curtype<>17)or(curexp<32768)then begin disperr(0,1109);
begin helpptr:=2;helpline[1]:=1110;helpline[0]:=1111;end;putgeterror;
end else begin j:=roundunscaled(curexp);
if curcmd<>80 then begin missingerr(58);begin helpptr:=1;
helpline[0]:=1112;end;backerror;end;
if c=3 then{1159:}repeat if j>headersize then overflow(1097,headersize);
headerbyte[j]:=getcode;j:=j+1;
until curcmd<>81{:1159}else{1160:}repeat if j>maxfontdimen then overflow
(1098,maxfontdimen);while j>np do begin np:=np+1;param[np]:=0;end;
getxnext;scanexpression;if curtype<>17 then begin disperr(0,1130);
begin helpptr:=1;helpline[0]:=311;end;putgetflusherror(0);end;
param[j]:=curexp;j:=j+1;until curcmd<>81{:1160};end;end;end;end;
{:1151}{1209:}procedure domapfile;begin getxnext;scanexpression;
if curtype<>4 then{1210:}begin disperr(0,1156);begin helpptr:=1;
helpline[0]:=1157;end;putgeterror;end{:1210}else mpmapfile(curexp);end;
procedure domapline;begin getxnext;scanexpression;
if curtype<>4 then{1210:}begin disperr(0,1156);begin helpptr:=1;
helpline[0]:=1157;end;putgeterror;
end{:1210}else begin mpmapline(curexp);end;end;
{:1209}{1280:}procedure dospecial;begin getxnext;scanexpression;
if curtype<>4 then{1281:}begin disperr(0,1156);begin helpptr:=1;
helpline[0]:=1217;end;putgeterror;
end{:1281}else begin mem[lastpending].hh.rh:=stashcurexp;
lastpending:=mem[lastpending].hh.rh;mem[lastpending].hh.rh:=0;end;end;
{:1280}{1315:}procedure storememfile;label 30;var k:integer;
p,q:halfword;x:integer;w:fourquarters;s:strnumber;
begin{1329:}selector:=4;print(1303);print(jobname);printchar(32);
printint(roundunscaled(internal[13])mod 100);printchar(46);
printint(roundunscaled(internal[14]));printchar(46);
printint(roundunscaled(internal[15]));printchar(41);
if interaction=0 then selector:=9 else selector:=10;
begin if poolptr+1>maxpoolptr then if poolptr+1>poolsize then
docompaction(1)else maxpoolptr:=poolptr+1;end;memident:=makestring;
strref[memident]:=127;packjobname(812);
while not wopenout(memfile)do promptfilename(1304,812);printnl(1305);
s:=wmakenamestring(memfile);print(s);flushstring(s);
printnl(memident){:1329};{1319:}begin memfile^.int:=283188218;
put(memfile);end;begin memfile^.int:=0;put(memfile);end;
begin memfile^.int:=30000;put(memfile);end;begin memfile^.int:=2100;
put(memfile);end;begin memfile^.int:=1777;put(memfile);end;
begin memfile^.int:=6;put(memfile);end{:1319};
{1321:}docompaction(poolsize);begin memfile^.int:=poolptr;put(memfile);
end;begin memfile^.int:=maxstrptr;put(memfile);end;
begin memfile^.int:=strptr;put(memfile);end;k:=0;
while(nextstr[k]=k+1)and(k<=maxstrptr)do k:=k+1;begin memfile^.int:=k;
put(memfile);end;
while k<=maxstrptr do begin begin memfile^.int:=nextstr[k];put(memfile);
end;k:=k+1;end;k:=0;while true do begin begin memfile^.int:=strstart[k];
put(memfile);end;if k=strptr then goto 30 else k:=nextstr[k];end;
30:k:=0;while k+4<poolptr do begin w.b0:=strpool[k]+0;
w.b1:=strpool[k+1]+0;w.b2:=strpool[k+2]+0;w.b3:=strpool[k+3]+0;
begin memfile^.qqqq:=w;put(memfile);end;k:=k+4;end;k:=poolptr-4;
w.b0:=strpool[k]+0;w.b1:=strpool[k+1]+0;w.b2:=strpool[k+2]+0;
w.b3:=strpool[k+3]+0;begin memfile^.qqqq:=w;put(memfile);end;println;
print(1299);printint(maxstrptr);print(1300);printint(poolptr){:1321};
{1323:}sortavail;varused:=0;begin memfile^.int:=lomemmax;put(memfile);
end;begin memfile^.int:=rover;put(memfile);end;p:=0;q:=rover;x:=0;
repeat for k:=p to q+1 do begin memfile^:=mem[k];put(memfile);end;
x:=x+q+2-p;varused:=varused+q-p;p:=q+mem[q].hh.lh;q:=mem[q+1].hh.rh;
until q=rover;varused:=varused+lomemmax-p;dynused:=memend+1-himemmin;
for k:=p to lomemmax do begin memfile^:=mem[k];put(memfile);end;
x:=x+lomemmax+1-p;begin memfile^.int:=himemmin;put(memfile);end;
begin memfile^.int:=avail;put(memfile);end;
for k:=himemmin to memend do begin memfile^:=mem[k];put(memfile);end;
x:=x+memend+1-himemmin;p:=avail;while p<>0 do begin dynused:=dynused-1;
p:=mem[p].hh.rh;end;begin memfile^.int:=varused;put(memfile);end;
begin memfile^.int:=dynused;put(memfile);end;println;printint(x);
print(1301);printint(varused);printchar(38);printint(dynused){:1323};
{1325:}begin memfile^.int:=hashused;put(memfile);end;
stcount:=2356-hashused;
for p:=1 to hashused do if hash[p].rh<>0 then begin begin memfile^.int:=
p;put(memfile);end;begin memfile^.hh:=hash[p];put(memfile);end;
begin memfile^.hh:=eqtb[p];put(memfile);end;stcount:=stcount+1;end;
for p:=hashused+1 to 2371 do begin begin memfile^.hh:=hash[p];
put(memfile);end;begin memfile^.hh:=eqtb[p];put(memfile);end;end;
begin memfile^.int:=stcount;put(memfile);end;println;printint(stcount);
print(1302){:1325};{1327:}begin memfile^.int:=intptr;put(memfile);end;
for k:=1 to intptr do begin begin memfile^.int:=internal[k];
put(memfile);end;begin memfile^.int:=intname[k];put(memfile);end;end;
begin memfile^.int:=startsym;put(memfile);end;
begin memfile^.int:=interaction;put(memfile);end;
begin memfile^.int:=memident;put(memfile);end;begin memfile^.int:=bgloc;
put(memfile);end;begin memfile^.int:=egloc;put(memfile);end;
begin memfile^.int:=serialno;put(memfile);end;begin memfile^.int:=69073;
put(memfile);end;internal[10]:=0{:1327};{1330:}wclose(memfile){:1330};
end;{:1315}procedure dostatement;begin curtype:=1;getxnext;
if curcmd>45 then{1012:}begin if curcmd<82 then begin begin if
interaction=3 then;printnl(263);print(947);end;
printcmdmod(curcmd,curmod);printchar(39);begin helpptr:=5;
helpline[4]:=948;helpline[3]:=949;helpline[2]:=950;helpline[1]:=951;
helpline[0]:=952;end;backerror;getxnext;end;
end{:1012}else if curcmd>32 then{1015:}begin varflag:=76;scanexpression;
if curcmd<83 then begin if curcmd=53 then doequation else if curcmd=76
then doassignment else if curtype=4 then{1016:}begin if internal[1]>0
then begin printnl(287);print(curexp);break(termout);end;
end{:1016}else if curtype<>1 then begin disperr(0,957);begin helpptr:=3;
helpline[2]:=958;helpline[1]:=959;helpline[0]:=960;end;putgeterror;end;
flushcurexp(0);curtype:=1;end;
end{:1015}else{1014:}begin if internal[6]>0 then showcmdmod(curcmd,
curmod);case curcmd of 32:dotypedeclaration;
18:if curmod>2 then makeopdef else if curmod>0 then scandef;
{1042:}26:dorandomseed;{:1042}{1045:}25:begin println;
interaction:=curmod;
{84:}if interaction=0 then selector:=7 else selector:=8{:84};
if logopened then selector:=selector+2;getxnext;end;
{:1045}{1048:}23:doprotection;{:1048}{1052:}29:defdelims;
{:1052}{1055:}14:repeat getsymbol;savevariable(cursym);getxnext;
until curcmd<>81;15:dointerim;16:dolet;17:donewinternal;
{:1055}{1061:}24:doshowwhatever;{:1061}{1096:}20:doaddto;21:dobounds;
{:1096}{1111:}19:doshipout;{:1111}{1114:}28:begin getsymbol;
startsym:=cursym;getxnext;end;{:1114}{1119:}27:domessage;
{:1119}{1126:}31:dowrite;{:1126}{1145:}22:dotfmcommand;
{:1145}{1279:}30:if curmod=0 then dospecial else if curmod=1 then
domapfile else domapline;{:1279}end;curtype:=1;end{:1014};
if curcmd<82 then{1013:}begin begin if interaction=3 then;printnl(263);
print(953);end;begin helpptr:=6;helpline[5]:=954;helpline[4]:=955;
helpline[3]:=956;helpline[2]:=950;helpline[1]:=951;helpline[0]:=952;end;
backerror;scannerstatus:=2;repeat begin getnext;if curcmd<=3 then tnext;
end;{716:}if curcmd=41 then begin if strref[curmod]<127 then if strref[
curmod]>1 then strref[curmod]:=strref[curmod]-1 else flushstring(curmod)
;end{:716};until curcmd>81;scannerstatus:=0;end{:1013};errorcount:=0;
end;{:1011}{1039:}procedure maincontrol;begin repeat dostatement;
if curcmd=83 then begin begin if interaction=3 then;printnl(263);
print(989);end;begin helpptr:=2;helpline[1]:=990;helpline[0]:=755;end;
flusherror(0);end;until curcmd=84;end;
{:1039}{1162:}function sortin(v:scaled):halfword;label 40;
var p,q,r:halfword;begin p:=29999;while true do begin q:=mem[p].hh.rh;
if v<=mem[q+1].int then goto 40;p:=q;end;
40:if v<mem[q+1].int then begin r:=getnode(2);mem[r+1].int:=v;
mem[r].hh.rh:=q;mem[p].hh.rh:=r;end;sortin:=mem[p].hh.rh;end;
{:1162}{1163:}function mincover(d:scaled):integer;var p:halfword;
l:scaled;m:integer;begin m:=0;p:=mem[29999].hh.rh;
perturbation:=2147483647;while p<>11 do begin m:=m+1;l:=mem[p+1].int;
repeat p:=mem[p].hh.rh;until mem[p+1].int>l+d;
if mem[p+1].int-l<perturbation then perturbation:=mem[p+1].int-l;end;
mincover:=m;end;{:1163}{1165:}function threshold(m:integer):scaled;
var d:scaled;begin excess:=mincover(0)-m;
if excess<=0 then threshold:=0 else begin repeat d:=perturbation;
until mincover(d+d)<=m;while mincover(d)>m do d:=perturbation;
threshold:=d;end;end;{:1165}{1166:}function skimp(m:integer):integer;
var d:scaled;p,q,r:halfword;l:scaled;v:scaled;begin d:=threshold(m);
perturbation:=0;q:=29999;m:=0;p:=mem[29999].hh.rh;
while p<>11 do begin m:=m+1;l:=mem[p+1].int;mem[p].hh.lh:=m;
if mem[mem[p].hh.rh+1].int<=l+d then{1167:}begin repeat p:=mem[p].hh.rh;
mem[p].hh.lh:=m;excess:=excess-1;if excess=0 then d:=0;
until mem[mem[p].hh.rh+1].int>l+d;v:=l+(mem[p+1].int-l)div 2;
if mem[p+1].int-v>perturbation then perturbation:=mem[p+1].int-v;r:=q;
repeat r:=mem[r].hh.rh;mem[r+1].int:=v;until r=p;mem[q].hh.rh:=p;
end{:1167};q:=p;p:=mem[p].hh.rh;end;skimp:=m;end;
{:1166}{1168:}procedure tfmwarning(m:smallnumber);begin printnl(1131);
print(intname[m]);print(1132);printscaled(perturbation);print(1133);end;
{:1168}{1173:}procedure fixdesignsize;var d:scaled;
begin d:=internal[23];
if(d<65536)or(d>=134217728)then begin if d<>0 then printnl(1134);
d:=8388608;internal[23]:=d;end;
if headerbyte[5]<0 then if headerbyte[6]<0 then if headerbyte[7]<0 then
if headerbyte[8]<0 then begin headerbyte[5]:=d div 1048576;
headerbyte[6]:=(d div 4096)mod 256;headerbyte[7]:=(d div 16)mod 256;
headerbyte[8]:=(d mod 16)*16;end;
maxtfmdimen:=16*internal[23]-internal[23]div 2097152;
if maxtfmdimen>=134217728 then maxtfmdimen:=134217727;end;
{:1173}{1174:}function dimenout(x:scaled):integer;
begin if abs(x)>maxtfmdimen then begin tfmchanged:=tfmchanged+1;
if x>0 then x:=16777215 else x:=-16777215;
end else x:=makescaled(x*16,internal[23]);dimenout:=x;end;
{:1174}{1176:}procedure fixchecksum;label 10;var k:eightbits;
b1,b2,b3,b4:eightbits;x:integer;
begin if headerbyte[1]<0 then if headerbyte[2]<0 then if headerbyte[3]<0
then if headerbyte[4]<0 then begin{1177:}b1:=bc;b2:=ec;b3:=bc;b4:=ec;
tfmchanged:=0;
for k:=bc to ec do if charexists[k]then begin x:=dimenout(mem[tfmwidth[k
]+1].int)+(k+4)*4194304;b1:=(b1+b1+x)mod 255;b2:=(b2+b2+x)mod 253;
b3:=(b3+b3+x)mod 251;b4:=(b4+b4+x)mod 247;end{:1177};headerbyte[1]:=b1;
headerbyte[2]:=b2;headerbyte[3]:=b3;headerbyte[4]:=b4;goto 10;end;
for k:=1 to 4 do if headerbyte[k]<0 then headerbyte[k]:=0;10:end;
{:1176}{1178:}procedure tfmtwo(x:integer);
begin write(tfmfile,x div 256);write(tfmfile,x mod 256);end;
procedure tfmfour(x:integer);
begin if x>=0 then write(tfmfile,x div 16777216)else begin x:=x
+1073741824;x:=x+1073741824;write(tfmfile,(x div 16777216)+128);end;
x:=x mod 16777216;write(tfmfile,x div 65536);x:=x mod 65536;
write(tfmfile,x div 256);write(tfmfile,x mod 256);end;
procedure tfmqqqq(x:fourquarters);begin write(tfmfile,x.b0-0);
write(tfmfile,x.b1-0);write(tfmfile,x.b2-0);write(tfmfile,x.b3-0);end;
{:1178}{1211:}function getnullfont:fontnumber;begin getnullfont:=0;end;
procedure flushstr(s:strnumber);begin flushstring(s);end;
function getnullstr:strnumber;begin getnullstr:=287;end;
function gettermandlogid:integer;begin gettermandlogid:=10;end;
function getcharwidth(f:fontnumber;c:eightbits):scaled;
begin if((fontbc[f]<=c)and(c<=fontec[f])and(fontinfo[charbase[f]+c].qqqq
.b0>0))then getcharwidth:=fontinfo[widthbase[f]+fontinfo[charbase[f]+c].
qqqq.b0].int else getcharwidth:=0;end;function tfmlookup(s:strnumber;
fs:scaled):fontnumber;var k:fontnumber;
begin if fs<>0 then begin for k:=1 to lastfnum do if strvsstr(fontname[k
],s)and(fontsizes[k]=fs)then begin flushstr(s);tfmlookup:=k;goto 10;end;
end else begin for k:=1 to lastfnum do if strvsstr(fontname[k],s)then
begin flushstr(s);tfmlookup:=k;goto 10;end;end;tfmlookup:=0;10:end;
function newdummyfont:fontnumber;begin newdummyfont:=readfontinfo(1158);
end;function roundxnoverd(x:scaled;n,d:integer):scaled;
var positive:boolean;t,u,v:nonnegativeinteger;
begin if x>=0 then positive:=true else begin x:=-x;positive:=false;end;
t:=(x mod 32768)*n;u:=(x div 32768)*n+(t div 32768);
v:=(u mod d)*32768+(t mod 32768);
if u div d>=32768 then aritherror:=true else u:=32768*(u div d)+(v div d
);v:=v mod d;if 2*v>=d then u:=u+1;
if positive then roundxnoverd:=u else roundxnoverd:=-u;end;
{:1211}{1216:}function dividescaled(s,m:scaled;dd:integer):scaled;
var q,r:scaled;sign,i:integer;begin sign:=1;
if s<0 then begin sign:=-sign;s:=-s;end;if m<0 then begin sign:=-sign;
m:=-m;end;
if m=0 then confusion(1159)else if m>=(2147483647 div 10)then confusion(
1160);q:=s div m;r:=s mod m;for i:=1 to dd do begin q:=10*q+(10*r)div m;
r:=(10*r)mod m;end;if 2*r>=m then begin q:=q+1;r:=r-m;end;
scaledout:=sign*(s-(r div tenpow[dd]));dividescaled:=sign*q;end;
{:1216}{1287:}procedure listusedresources;label 40,42;
var f,ff:fontnumber;ldf:fontnumber;firstitem:boolean;
begin if internal[36]>0 then printnl(1267)else printnl(1268);ldf:=0;
firstitem:=true;
for f:=1 to lastfnum do if(fontsizes[f]<>0)and(fontisreencoded(f))then
begin for ff:=ldf downto 0 do if fontsizes[ff]<>0 then if strvsstr(
fontencname[f],fontencname[ff])=0 then goto 40;
if fontissubsetted(f)then goto 40;
if psoffset+1+(strstart[nextstr[fontencname[f]]]-strstart[fontencname[f]
])>maxprintline then printnl(1269);
if firstitem then begin firstitem:=false;printnl(1269);end;
printchar(32);print(fontencname[f]);ldf:=f;40:end;ldf:=0;
firstitem:=true;
for f:=1 to lastfnum do if fontsizes[f]<>0 then begin for ff:=ldf downto
0 do if fontsizes[ff]<>0 then if strvsstr(fontname[f],fontname[ff])=0
then goto 42;
if psoffset+1+(strstart[nextstr[fontpsname[f]]]-strstart[fontpsname[f]])
>maxprintline then printnl(1270);
if firstitem then begin firstitem:=false;printnl(1270);end;
printchar(32);if(internal[32]=196608)and(fontissubsetted(f))then print(
fmfontsubsetname(f))else print(fontpsname[f]);ldf:=f;42:end;println;end;
{:1287}{1288:}procedure listsuppliedresources;label 40,42;
var f,ff:fontnumber;ldf:fontnumber;firstitem:boolean;
begin if internal[36]>0 then printnl(1271)else printnl(1272);ldf:=0;
firstitem:=true;
for f:=1 to lastfnum do if(fontsizes[f]<>0)and(fontisreencoded(f))then
begin for ff:=ldf downto 0 do if fontsizes[ff]<>0 then if strvsstr(
fontencname[f],fontencname[ff])=0 then goto 40;
if(internal[32]=196608)and(fontissubsetted(f))then goto 40;
if psoffset+1+(strstart[nextstr[fontencname[f]]]-strstart[fontencname[f]
])>maxprintline then printnl(1269);
if firstitem then begin firstitem:=false;printnl(1269);end;
printchar(32);print(fontencname[f]);ldf:=f;40:end;ldf:=0;
firstitem:=true;
if internal[32]=196608 then begin for f:=1 to lastfnum do if fontsizes[f
]<>0 then begin for ff:=ldf downto 0 do if fontsizes[ff]<>0 then if
strvsstr(fontname[f],fontname[ff])=0 then goto 42;
if not fontisincluded(f)then goto 42;
if psoffset+1+(strstart[nextstr[fontpsname[f]]]-strstart[fontpsname[f]])
>maxprintline then printnl(1270);
if firstitem then begin firstitem:=false;printnl(1270);end;
printchar(32);
if fontissubsetted(f)then print(fmfontsubsetname(f))else print(
fontpsname[f]);ldf:=f;42:end;println;end;end;
{:1288}{1289:}procedure listneededresources;label 40,42;
var f,ff:fontnumber;ldf:fontnumber;firstitem:boolean;begin ldf:=0;
firstitem:=true;
for f:=1 to lastfnum do if fontsizes[f]<>0 then begin for ff:=ldf downto
0 do if fontsizes[ff]<>0 then if strvsstr(fontname[f],fontname[ff])=0
then goto 40;if(internal[32]=196608)and(fontisincluded(f))then goto 40;
if psoffset+1+(strstart[nextstr[fontpsname[f]]]-strstart[fontpsname[f]])
>maxprintline then printnl(1270);
if firstitem then begin firstitem:=false;printnl(1273);end;
printchar(32);print(fontpsname[f]);ldf:=f;40:end;
if not firstitem then begin println;ldf:=0;firstitem:=true;
for f:=1 to lastfnum do if fontsizes[f]<>0 then begin for ff:=ldf downto
0 do if fontsizes[ff]<>0 then if strvsstr(fontname[f],fontname[ff])=0
then goto 42;if(internal[32]=196608)and(fontisincluded(f))then goto 42;
print(1274);print(fontpsname[f]);println;ldf:=f;42:end;end;end;
{:1289}{1316:}{757:}function openmemfile:boolean;label 40,10;
var j:0..bufsize;begin j:=curinput.locfield;
if buffer[curinput.locfield]=38 then begin curinput.locfield:=curinput.
locfield+1;j:=curinput.locfield;buffer[last]:=32;
while buffer[j]<>32 do j:=j+1;packbufferedname(0,curinput.locfield,j-1);
if wopenin(memfile)then goto 40;
packbufferedname(6,curinput.locfield,j-1);
if wopenin(memfile)then goto 40;;
writeln(termout,'Sorry, I can''t find that mem file;',' will try PLAIN.'
);break(termout);end;packbufferedname(11,1,0);
if not wopenin(memfile)then begin;
writeln(termout,'I can''t find the PLAIN mem file!');openmemfile:=false;
goto 10;end;40:curinput.locfield:=j;openmemfile:=true;10:end;
{:757}function loadmemfile:boolean;label 30,6666,10;var k:integer;
p,q:halfword;x:integer;s:strnumber;w:fourquarters;
begin{1320:}x:=memfile^.int;if x<>283188218 then goto 6666;
begin get(memfile);x:=memfile^.int;end;if x<>0 then goto 6666;
begin get(memfile);x:=memfile^.int;end;if x<>30000 then goto 6666;
begin get(memfile);x:=memfile^.int;end;if x<>2100 then goto 6666;
begin get(memfile);x:=memfile^.int;end;if x<>1777 then goto 6666;
begin get(memfile);x:=memfile^.int;end;if x<>6 then goto 6666{:1320};
{1322:}begin begin get(memfile);x:=memfile^.int;end;
if x<0 then goto 6666;if x>poolsize then begin;
writeln(termout,'---! Must increase the ','string pool size');goto 6666;
end else poolptr:=x;end;begin begin get(memfile);x:=memfile^.int;end;
if x<0 then goto 6666;if x>maxstrings-1 then begin;
writeln(termout,'---! Must increase the ','max strings');goto 6666;
end else maxstrptr:=x;end;begin begin get(memfile);x:=memfile^.int;end;
if(x<0)or(x>maxstrptr)then goto 6666 else strptr:=x;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<0)or(x>maxstrptr+1)then goto 6666 else s:=x;end;
for k:=0 to s-1 do nextstr[k]:=k+1;
for k:=s to maxstrptr do begin begin get(memfile);x:=memfile^.int;end;
if(x<s+1)or(x>maxstrptr+1)then goto 6666 else nextstr[k]:=x;end;
fixedstruse:=0;k:=0;while true do begin begin begin get(memfile);
x:=memfile^.int;end;
if(x<0)or(x>poolptr)then goto 6666 else strstart[k]:=x;end;
if k=strptr then goto 30;strref[k]:=127;fixedstruse:=fixedstruse+1;
lastfixedstr:=k;k:=nextstr[k];end;30:k:=0;
while k+4<poolptr do begin begin get(memfile);w:=memfile^.qqqq;end;
strpool[k]:=w.b0-0;strpool[k+1]:=w.b1-0;strpool[k+2]:=w.b2-0;
strpool[k+3]:=w.b3-0;k:=k+4;end;k:=poolptr-4;begin get(memfile);
w:=memfile^.qqqq;end;strpool[k]:=w.b0-0;strpool[k+1]:=w.b1-0;
strpool[k+2]:=w.b2-0;strpool[k+3]:=w.b3-0;initstruse:=fixedstruse;
initpoolptr:=poolptr;maxpoolptr:=poolptr;strsusedup:=fixedstruse;
{poolinuse:=strstart[strptr];strsinuse:=fixedstruse;
maxplused:=poolinuse;maxstrsused:=strsinuse;pactcount:=0;pactchars:=0;
pactstrs:=0;}{:1322};{1324:}begin begin get(memfile);x:=memfile^.int;
end;if(x<1023)or(x>29996)then goto 6666 else lomemmax:=x;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<24)or(x>lomemmax)then goto 6666 else rover:=x;end;p:=0;q:=rover;
repeat for k:=p to q+1 do begin get(memfile);mem[k]:=memfile^;end;
p:=q+mem[q].hh.lh;
if(p>lomemmax)or((q>=mem[q+1].hh.rh)and(mem[q+1].hh.rh<>rover))then goto
6666;q:=mem[q+1].hh.rh;until q=rover;
for k:=p to lomemmax do begin get(memfile);mem[k]:=memfile^;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<lomemmax+1)or(x>29997)then goto 6666 else himemmin:=x;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<0)or(x>30000)then goto 6666 else avail:=x;end;memend:=30000;
for k:=himemmin to memend do begin get(memfile);mem[k]:=memfile^;end;
begin get(memfile);varused:=memfile^.int;end;begin get(memfile);
dynused:=memfile^.int;end{:1324};{1326:}begin begin get(memfile);
x:=memfile^.int;end;if(x<1)or(x>2357)then goto 6666 else hashused:=x;
end;p:=0;repeat begin begin get(memfile);x:=memfile^.int;end;
if(x<p+1)or(x>hashused)then goto 6666 else p:=x;end;begin get(memfile);
hash[p]:=memfile^.hh;end;begin get(memfile);eqtb[p]:=memfile^.hh;end;
until p=hashused;for p:=hashused+1 to 2371 do begin begin get(memfile);
hash[p]:=memfile^.hh;end;begin get(memfile);eqtb[p]:=memfile^.hh;end;
end;begin get(memfile);stcount:=memfile^.int;end{:1326};
{1328:}begin begin get(memfile);x:=memfile^.int;end;
if(x<37)or(x>maxinternal)then goto 6666 else intptr:=x;end;
for k:=1 to intptr do begin begin get(memfile);
internal[k]:=memfile^.int;end;begin begin get(memfile);x:=memfile^.int;
end;if(x<0)or(x>strptr)then goto 6666 else intname[k]:=x;end;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<0)or(x>2357)then goto 6666 else startsym:=x;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<0)or(x>3)then goto 6666 else interaction:=x;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<0)or(x>strptr)then goto 6666 else memident:=x;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<1)or(x>2371)then goto 6666 else bgloc:=x;end;
begin begin get(memfile);x:=memfile^.int;end;
if(x<1)or(x>2371)then goto 6666 else egloc:=x;end;begin get(memfile);
serialno:=memfile^.int;end;begin get(memfile);x:=memfile^.int;end;
if(x<>69073)or eof(memfile)then goto 6666{:1328};loadmemfile:=true;
goto 10;6666:;writeln(termout,'(Fatal mem file error; I''m stymied)');
loadmemfile:=false;10:end;{:1316}{1331:}{812:}procedure scanprimary;
label 20,30,31,32;var p,q,r:halfword;c:quarterword;myvarflag:0..84;
ldelim,rdelim:halfword;{823:}groupline:integer;
{:823}{828:}num,denom:scaled;{:828}{835:}prehead,posthead,tail:halfword;
tt:smallnumber;t:halfword;macroref:halfword;
{:835}begin myvarflag:=varflag;varflag:=0;
20:begin if aritherror then cleararith;end;
{814:}{if panicking then checkmem(false);}
if interrupt<>0 then if OKtointerrupt then begin backinput;
begin if interrupt<>0 then pauseforinstructions;end;getxnext;end{:814};
case curcmd of 33:{815:}begin ldelim:=cursym;rdelim:=curmod;getxnext;
scanexpression;
if(curcmd=81)and(curtype>=17)then{819:}begin p:=stashcurexp;getxnext;
scanexpression;{820:}if curtype<17 then begin disperr(0,851);
begin helpptr:=4;helpline[3]:=852;helpline[2]:=853;helpline[1]:=854;
helpline[0]:=855;end;putgetflusherror(0);end{:820};q:=getnode(2);
mem[q].hh.b1:=19;
if curcmd=81 then mem[q].hh.b0:=13 else mem[q].hh.b0:=15;initbignode(q);
r:=mem[q+1].int;stashin(r+2);unstashcurexp(p);stashin(r);
if curcmd=81 then{821:}begin getxnext;scanexpression;
if curtype<17 then begin disperr(0,856);begin helpptr:=3;
helpline[2]:=857;helpline[1]:=854;helpline[0]:=858;end;
putgetflusherror(0);end;stashin(r+4);end{:821};
if curcmd=81 then begin mem[q].hh.b0:=14;initbignode(q);t:=mem[q+1].int;
mem[t]:=mem[r];mem[t+1].int:=mem[r+1].int;mem[t+2]:=mem[r+2];
mem[t+3].int:=mem[r+3].int;mem[t+4]:=mem[r+4];
mem[t+5].int:=mem[r+5].int;recyclevalue(r);r:=t;{822:}begin getxnext;
scanexpression;if curtype<17 then begin disperr(0,859);begin helpptr:=3;
helpline[2]:=860;helpline[1]:=854;helpline[0]:=861;end;
putgetflusherror(0);end;stashin(r+6);end{:822};end;
checkdelimiter(ldelim,rdelim);curtype:=mem[q].hh.b0;curexp:=q;
end{:819}else checkdelimiter(ldelim,rdelim);end{:815};
34:{824:}begin groupline:=trueline;
if internal[6]>0 then showcmdmod(curcmd,curmod);begin p:=getavail;
mem[p].hh.lh:=0;mem[p].hh.rh:=saveptr;saveptr:=p;end;repeat dostatement;
until curcmd<>82;if curcmd<>83 then begin begin if interaction=3 then;
printnl(263);print(862);end;printint(groupline);print(863);
begin helpptr:=2;helpline[1]:=864;helpline[0]:=865;end;backerror;
curcmd:=83;end;unsave;if internal[6]>0 then showcmdmod(curcmd,curmod);
end{:824};41:{825:}begin curtype:=4;curexp:=curmod;end{:825};
44:{829:}begin curexp:=curmod;curtype:=17;getxnext;
if curcmd<>56 then begin num:=0;denom:=0;end else begin getxnext;
if curcmd<>44 then begin backinput;curcmd:=56;curmod:=98;cursym:=2361;
goto 30;end;num:=curexp;denom:=curmod;
if denom=0 then{830:}begin begin if interaction=3 then;printnl(263);
print(866);end;begin helpptr:=1;helpline[0]:=867;end;error;
end{:830}else curexp:=makescaled(num,denom);
begin if aritherror then cleararith;end;getxnext;end;
if curcmd>=32 then if curcmd<44 then begin p:=stashcurexp;scanprimary;
if(abs(num)>=abs(denom))or(curtype<13)then dobinary(p,97)else begin
fracmult(num,denom);freenode(p,2);end;end;goto 30;end{:829};
35:{826:}donullary(curmod){:826};36,32,38,45:{827:}begin c:=curmod;
getxnext;scanprimary;dounary(c);goto 30;end{:827};
39:{831:}begin c:=curmod;getxnext;scanexpression;
if curcmd<>70 then begin missingerr(503);print(781);printcmdmod(39,c);
begin helpptr:=1;helpline[0]:=782;end;backerror;end;p:=stashcurexp;
getxnext;scanprimary;dobinary(p,c);goto 30;end{:831};
37:{832:}begin getxnext;scansuffix;oldsetting:=selector;selector:=4;
showtokenlist(curexp,0,100000,0);flushtokenlist(curexp);
curexp:=makestring;selector:=oldsetting;curtype:=4;goto 30;end{:832};
42:{833:}begin q:=curmod;if myvarflag=76 then begin getxnext;
if curcmd=76 then begin curexp:=getavail;mem[curexp].hh.lh:=q+2371;
curtype:=21;goto 30;end;backinput;end;curtype:=17;curexp:=internal[q];
end{:833};40:makeexpcopy(curmod);43:{836:}begin begin prehead:=avail;
if prehead=0 then prehead:=getavail else begin avail:=mem[prehead].hh.rh
;mem[prehead].hh.rh:=0;{dynused:=dynused+1;}end;end;tail:=prehead;
posthead:=0;tt:=1;while true do begin t:=curtok;mem[tail].hh.rh:=t;
if tt<>0 then begin{842:}begin p:=mem[prehead].hh.rh;q:=mem[p].hh.lh;
tt:=0;if eqtb[q].lh mod 85=43 then begin q:=eqtb[q].rh;
if q=0 then goto 32;while true do begin p:=mem[p].hh.rh;
if p=0 then begin tt:=mem[q].hh.b0;goto 32;end;
if mem[q].hh.b0<>22 then goto 32;q:=mem[mem[q+1].hh.lh].hh.rh;
if p>=himemmin then begin repeat q:=mem[q].hh.rh;
until mem[q+2].hh.lh>=mem[p].hh.lh;
if mem[q+2].hh.lh>mem[p].hh.lh then goto 32;end;end;end;32:end{:842};
if tt>=23 then{837:}begin mem[tail].hh.rh:=0;
if tt>23 then begin posthead:=getavail;tail:=posthead;
mem[tail].hh.rh:=t;tt:=0;macroref:=mem[q+1].int;
mem[macroref].hh.lh:=mem[macroref].hh.lh+1;
end else{845:}begin p:=getavail;mem[prehead].hh.lh:=mem[prehead].hh.rh;
mem[prehead].hh.rh:=p;mem[p].hh.lh:=t;macrocall(mem[q+1].int,prehead,0);
getxnext;goto 20;end{:845};end{:837};end;getxnext;tail:=t;
if curcmd=65 then{838:}begin getxnext;scanexpression;
if curcmd<>66 then{839:}begin backinput;backexpr;curcmd:=65;curmod:=0;
cursym:=2360;end{:839}else begin if curtype<>17 then badsubscript;
curcmd:=44;curmod:=curexp;cursym:=0;end;end{:838};
if curcmd>44 then goto 31;if curcmd<42 then goto 31;end;
31:{844:}if posthead<>0 then{846:}begin backinput;p:=getavail;
q:=mem[posthead].hh.rh;mem[prehead].hh.lh:=mem[prehead].hh.rh;
mem[prehead].hh.rh:=posthead;mem[posthead].hh.lh:=q;
mem[posthead].hh.rh:=p;mem[p].hh.lh:=mem[q].hh.rh;mem[q].hh.rh:=0;
macrocall(macroref,prehead,0);
mem[macroref].hh.lh:=mem[macroref].hh.lh-1;getxnext;goto 20;end{:846};
q:=mem[prehead].hh.rh;begin mem[prehead].hh.rh:=avail;avail:=prehead;
{dynused:=dynused-1;}end;if curcmd=myvarflag then begin curtype:=21;
curexp:=q;goto 30;end;p:=findvariable(q);
if p<>0 then makeexpcopy(p)else begin obliterated(q);helpline[2]:=879;
helpline[1]:=880;helpline[0]:=881;putgetflusherror(0);end;
flushnodelist(q);goto 30{:844};end{:836};others:begin badexp(845);
goto 20;end end;getxnext;
30:if curcmd=65 then if curtype>=17 then{851:}begin p:=stashcurexp;
getxnext;scanexpression;if curcmd<>81 then begin{839:}begin backinput;
backexpr;curcmd:=65;curmod:=0;cursym:=2360;end{:839};unstashcurexp(p);
end else begin q:=stashcurexp;getxnext;scanexpression;
if curcmd<>66 then begin missingerr(93);begin helpptr:=3;
helpline[2]:=883;helpline[1]:=884;helpline[0]:=763;end;backerror;end;
r:=stashcurexp;makeexpcopy(q);dobinary(r,96);dobinary(p,97);
dobinary(q,95);getxnext;end;end{:851};end;
{:812}{852:}procedure scansuffix;label 30;var h,t:halfword;p:halfword;
begin h:=getavail;t:=h;
while true do begin if curcmd=65 then{853:}begin getxnext;
scanexpression;if curtype<>17 then badsubscript;
if curcmd<>66 then begin missingerr(93);begin helpptr:=3;
helpline[2]:=885;helpline[1]:=884;helpline[0]:=763;end;backerror;end;
curcmd:=44;curmod:=curexp;end{:853};
if curcmd=44 then p:=newnumtok(curmod)else if(curcmd=43)or(curcmd=42)
then begin p:=getavail;mem[p].hh.lh:=cursym;end else goto 30;
mem[t].hh.rh:=p;t:=p;getxnext;end;30:curexp:=mem[h].hh.rh;
begin mem[h].hh.rh:=avail;avail:=h;{dynused:=dynused-1;}end;curtype:=21;
end;{:852}{854:}procedure scansecondary;label 20,22;var p:halfword;
c,d:halfword;macname:halfword;
begin 20:if(curcmd<32)or(curcmd>45)then badexp(886);scanprimary;
22:if curcmd<=57 then if curcmd>=54 then begin p:=stashcurexp;c:=curmod;
d:=curcmd;if d=55 then begin macname:=cursym;
mem[c].hh.lh:=mem[c].hh.lh+1;end;getxnext;scanprimary;
if d<>55 then dobinary(p,c)else begin backinput;binarymac(p,c,macname);
mem[c].hh.lh:=mem[c].hh.lh-1;getxnext;goto 20;end;goto 22;end;end;
{:854}{856:}procedure scantertiary;label 20,22;var p:halfword;
c,d:halfword;macname:halfword;
begin 20:if(curcmd<32)or(curcmd>45)then badexp(887);scansecondary;
22:if curcmd<=47 then if curcmd>=45 then begin p:=stashcurexp;c:=curmod;
d:=curcmd;if d=46 then begin macname:=cursym;
mem[c].hh.lh:=mem[c].hh.lh+1;end;getxnext;scansecondary;
if d<>46 then dobinary(p,c)else begin backinput;binarymac(p,c,macname);
mem[c].hh.lh:=mem[c].hh.lh-1;getxnext;goto 20;end;goto 22;end;end;
{:856}{857:}procedure scanexpression;label 20,30,22,25,26,10;
var p,q,r,pp,qq:halfword;c,d:halfword;myvarflag:0..84;macname:halfword;
cyclehit:boolean;x,y:scaled;t:0..4;begin myvarflag:=varflag;
20:if(curcmd<32)or(curcmd>45)then badexp(888);scantertiary;
22:if curcmd<=53 then if curcmd>=48 then if(curcmd<>53)or(myvarflag<>76)
then begin p:=stashcurexp;c:=curmod;d:=curcmd;
if d=51 then begin macname:=cursym;mem[c].hh.lh:=mem[c].hh.lh+1;end;
if(d<50)or((d=50)and((mem[p].hh.b0=15)or(mem[p].hh.b0=8)))then{858:}
begin cyclehit:=false;{859:}begin unstashcurexp(p);
if curtype=15 then p:=newknot else if curtype=8 then p:=curexp else goto
10;q:=p;while mem[q].hh.rh<>p do q:=mem[q].hh.rh;
if mem[p].hh.b0<>0 then begin r:=copyknot(p);mem[q].hh.rh:=r;q:=r;end;
mem[p].hh.b0:=4;mem[q].hh.b1:=4;end{:859};
25:{863:}if curcmd=48 then{868:}begin t:=scandirection;
if t<>4 then begin mem[q].hh.b1:=t;mem[q+5].int:=curexp;
if mem[q].hh.b0=4 then begin mem[q].hh.b0:=t;mem[q+3].int:=curexp;end;
end;end{:868};d:=curcmd;if d=49 then{870:}begin getxnext;
if curcmd=60 then{871:}begin getxnext;y:=curcmd;
if curcmd=61 then getxnext;scanprimary;
{872:}if(curtype<>17)or(curexp<49152)then begin disperr(0,906);
begin helpptr:=1;helpline[0]:=907;end;putgetflusherror(65536);end{:872};
if y=61 then curexp:=-curexp;mem[q+6].int:=curexp;
if curcmd=54 then begin getxnext;y:=curcmd;if curcmd=61 then getxnext;
scanprimary;
{872:}if(curtype<>17)or(curexp<49152)then begin disperr(0,906);
begin helpptr:=1;helpline[0]:=907;end;putgetflusherror(65536);end{:872};
if y=61 then curexp:=-curexp;end;y:=curexp;
end{:871}else if curcmd=59 then{873:}begin mem[q].hh.b1:=1;t:=1;
getxnext;scanprimary;knownpair;mem[q+5].int:=curx;mem[q+6].int:=cury;
if curcmd<>54 then begin x:=mem[q+5].int;y:=mem[q+6].int;
end else begin getxnext;scanprimary;knownpair;x:=curx;y:=cury;end;
end{:873}else begin mem[q+6].int:=65536;y:=65536;backinput;goto 30;end;
if curcmd<>49 then begin missingerr(324);begin helpptr:=1;
helpline[0]:=905;end;backerror;end;
30:end{:870}else if d<>50 then goto 26;getxnext;
if curcmd=48 then{869:}begin t:=scandirection;
if mem[q].hh.b1<>1 then x:=curexp else t:=1;
end{:869}else if mem[q].hh.b1<>1 then begin t:=4;x:=0;end{:863};
if curcmd=38 then{875:}begin cyclehit:=true;getxnext;pp:=p;qq:=p;
if d=50 then if p=q then begin d:=49;mem[q+6].int:=65536;y:=65536;end;
end{:875}else begin scantertiary;
{874:}begin if curtype<>8 then pp:=newknot else pp:=curexp;qq:=pp;
while mem[qq].hh.rh<>pp do qq:=mem[qq].hh.rh;
if mem[pp].hh.b0<>0 then begin r:=copyknot(pp);mem[qq].hh.rh:=r;qq:=r;
end;mem[pp].hh.b0:=4;mem[qq].hh.b1:=4;end{:874};end;
{876:}begin if d=50 then if(mem[q+1].int<>mem[pp+1].int)or(mem[q+2].int
<>mem[pp+2].int)then begin begin if interaction=3 then;printnl(263);
print(908);end;begin helpptr:=3;helpline[2]:=909;helpline[1]:=910;
helpline[0]:=911;end;putgeterror;d:=49;mem[q+6].int:=65536;y:=65536;end;
{878:}if mem[pp].hh.b1=4 then if(t=3)or(t=2)then begin mem[pp].hh.b1:=t;
mem[pp+5].int:=x;end{:878};
if d=50 then{879:}begin if mem[q].hh.b0=4 then if mem[q].hh.b1=4 then
begin mem[q].hh.b0:=3;mem[q+3].int:=65536;end;
if mem[pp].hh.b1=4 then if t=4 then begin mem[pp].hh.b1:=3;
mem[pp+5].int:=65536;end;mem[q].hh.b1:=mem[pp].hh.b1;
mem[q].hh.rh:=mem[pp].hh.rh;mem[q+5].int:=mem[pp+5].int;
mem[q+6].int:=mem[pp+6].int;freenode(pp,8);if qq=pp then qq:=q;
end{:879}else begin{877:}if mem[q].hh.b1=4 then if(mem[q].hh.b0=3)or(mem
[q].hh.b0=2)then begin mem[q].hh.b1:=mem[q].hh.b0;
mem[q+5].int:=mem[q+3].int;end{:877};mem[q].hh.rh:=pp;mem[pp+4].int:=y;
if t<>4 then begin mem[pp+3].int:=x;mem[pp].hh.b0:=t;end;end;q:=qq;
end{:876};
if curcmd>=48 then if curcmd<=50 then if not cyclehit then goto 25;
26:{880:}if cyclehit then begin if d=50 then p:=q;
end else begin mem[p].hh.b0:=0;
if mem[p].hh.b1=4 then begin mem[p].hh.b1:=3;mem[p+5].int:=65536;end;
mem[q].hh.b1:=0;if mem[q].hh.b0=4 then begin mem[q].hh.b0:=3;
mem[q+3].int:=65536;end;mem[q].hh.rh:=p;end;makechoices(p);curtype:=8;
curexp:=p{:880};end{:858}else begin getxnext;scantertiary;
if d<>51 then dobinary(p,c)else begin backinput;binarymac(p,c,macname);
mem[c].hh.lh:=mem[c].hh.lh-1;getxnext;goto 20;end;end;goto 22;end;
10:end;{:857}{881:}procedure getboolean;begin getxnext;scanexpression;
if curtype<>2 then begin disperr(0,912);begin helpptr:=2;
helpline[1]:=913;helpline[0]:=914;end;putgetflusherror(31);curtype:=2;
end;end;{:881}{243:}procedure printcapsule;begin printchar(40);
printexp(gpointer,0);printchar(41);end;procedure tokenrecycle;
begin recyclevalue(gpointer);end;
{:243}{1334:}procedure closefilesandterminate;var k:integer;lh:integer;
lkoffset:0..256;p:halfword;
begin{1335:}for k:=0 to readfiles-1 do if rdfname[k]<>0 then aclose(
rdfile[k]);
for k:=0 to writefiles-1 do if wrfname[k]<>0 then aclose(wrfile[k])
{:1335};
{if internal[10]>0 then[1338:]if logopened then begin writeln(logfile,
' ');
writeln(logfile,'Here is how much of MetaPost''s memory',' you used:');
write(logfile,' ',maxstrsused-initstruse:1,' string');
if maxstrsused<>initstruse+1 then write(logfile,'s');
writeln(logfile,' out of ',maxstrings-1-initstruse:1);
writeln(logfile,' ',maxplused-initpoolptr:1,' string characters out of '
,poolsize-initpoolptr:1);
writeln(logfile,' ',lomemmax+0+memend-himemmin+2:1,
' words of memory out of ',memend+1:1);
writeln(logfile,' ',stcount:1,' symbolic tokens out of ',2100:1);
writeln(logfile,' ',maxinstack:1,'i,',intptr:1,'n,',maxparamstack:1,'p,'
,maxbufstack+1:1,'b stack positions out of ',stacksize:1,'i,',
maxinternal:1,'n,',150:1,'p,',bufsize:1,'b');
writeln(logfile,' ',pactcount:1,' string compactions (moved ',pactchars:
1,' characters, ',pactstrs:1,' strings)');end[:1338];};
{1336:}if internal[26]>0 then begin{1337:}rover:=24;
mem[rover].hh.rh:=65535;lomemmax:=himemmin-1;
if lomemmax-rover>65535 then lomemmax:=65535+rover;
mem[rover].hh.lh:=lomemmax-rover;mem[rover+1].hh.lh:=rover;
mem[rover+1].hh.rh:=rover;mem[lomemmax].hh.rh:=0;
mem[lomemmax].hh.lh:=0{:1337};{1169:}mem[29999].hh.rh:=11;
for k:=bc to ec do if charexists[k]then tfmwidth[k]:=sortin(tfmwidth[k])
;nw:=skimp(255)+1;dimenhead[1]:=mem[29999].hh.rh;
if perturbation>=4096 then tfmwarning(19){:1169};fixdesignsize;
fixchecksum;{1171:}mem[29999].hh.rh:=11;
for k:=bc to ec do if charexists[k]then if tfmheight[k]=0 then tfmheight
[k]:=7 else tfmheight[k]:=sortin(tfmheight[k]);nh:=skimp(15)+1;
dimenhead[2]:=mem[29999].hh.rh;
if perturbation>=4096 then tfmwarning(20);mem[29999].hh.rh:=11;
for k:=bc to ec do if charexists[k]then if tfmdepth[k]=0 then tfmdepth[k
]:=7 else tfmdepth[k]:=sortin(tfmdepth[k]);nd:=skimp(15)+1;
dimenhead[3]:=mem[29999].hh.rh;
if perturbation>=4096 then tfmwarning(21);mem[29999].hh.rh:=11;
for k:=bc to ec do if charexists[k]then if tfmitalcorr[k]=0 then
tfmitalcorr[k]:=7 else tfmitalcorr[k]:=sortin(tfmitalcorr[k]);
ni:=skimp(63)+1;dimenhead[4]:=mem[29999].hh.rh;
if perturbation>=4096 then tfmwarning(22){:1171};internal[26]:=0;
{1179:}if jobname=0 then openlogfile;packjobname(1135);
while not bopenout(tfmfile)do promptfilename(1136,1135);
metricfilename:=bmakenamestring(tfmfile);{1180:}k:=headersize;
while headerbyte[k]<0 do k:=k-1;lh:=(k+3)div 4;if bc>ec then bc:=1;
{1182:}bchar:=roundunscaled(internal[31]);
if(bchar<0)or(bchar>255)then begin bchar:=-1;lkstarted:=false;
lkoffset:=0;end else begin lkstarted:=true;lkoffset:=1;end;
{1183:}k:=labelptr;if labelloc[k]+lkoffset>255 then begin lkoffset:=0;
lkstarted:=false;repeat charremainder[labelchar[k]]:=lkoffset;
while labelloc[k-1]=labelloc[k]do begin k:=k-1;
charremainder[labelchar[k]]:=lkoffset;end;lkoffset:=lkoffset+1;k:=k-1;
until lkoffset+labelloc[k]<256;end;
if lkoffset>0 then while k>0 do begin charremainder[labelchar[k]]:=
charremainder[labelchar[k]]+lkoffset;k:=k-1;end{:1183};
if bchlabel<ligtablesize then begin ligkern[nl].b0:=255;
ligkern[nl].b1:=0;ligkern[nl].b2:=((bchlabel+lkoffset)div 256)+0;
ligkern[nl].b3:=((bchlabel+lkoffset)mod 256)+0;nl:=nl+1;end{:1182};
tfmtwo(6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+lkoffset+nk+ne+np);tfmtwo(lh);
tfmtwo(bc);tfmtwo(ec);tfmtwo(nw);tfmtwo(nh);tfmtwo(nd);tfmtwo(ni);
tfmtwo(nl+lkoffset);tfmtwo(nk);tfmtwo(ne);tfmtwo(np);
for k:=1 to 4*lh do begin if headerbyte[k]<0 then headerbyte[k]:=0;
write(tfmfile,headerbyte[k]);end{:1180};
{1181:}for k:=bc to ec do if not charexists[k]then tfmfour(0)else begin
write(tfmfile,mem[tfmwidth[k]].hh.lh);
write(tfmfile,(mem[tfmheight[k]].hh.lh)*16+mem[tfmdepth[k]].hh.lh);
write(tfmfile,(mem[tfmitalcorr[k]].hh.lh)*4+chartag[k]);
write(tfmfile,charremainder[k]);end;tfmchanged:=0;
for k:=1 to 4 do begin tfmfour(0);p:=dimenhead[k];
while p<>11 do begin tfmfour(dimenout(mem[p+1].int));p:=mem[p].hh.rh;
end;end{:1181};
{1184:}for k:=0 to 255 do if skiptable[k]<ligtablesize then begin
printnl(1138);printint(k);print(1139);ll:=skiptable[k];
repeat lll:=ligkern[ll].b0-0;ligkern[ll].b0:=128;ll:=ll-lll;until lll=0;
end;if lkstarted then begin write(tfmfile,255);write(tfmfile,bchar);
tfmtwo(0);end else for k:=1 to lkoffset do begin ll:=labelloc[labelptr];
if bchar<0 then begin write(tfmfile,254);write(tfmfile,0);
end else begin write(tfmfile,255);write(tfmfile,bchar);end;
tfmtwo(ll+lkoffset);repeat labelptr:=labelptr-1;
until labelloc[labelptr]<ll;end;for k:=0 to nl-1 do tfmqqqq(ligkern[k]);
for k:=0 to nk-1 do tfmfour(dimenout(kern[k])){:1184};
{1185:}for k:=0 to ne-1 do tfmqqqq(exten[k]);
for k:=1 to np do if k=1 then if abs(param[1])<134217728 then tfmfour(
param[1]*16)else begin tfmchanged:=tfmchanged+1;
if param[1]>0 then tfmfour(2147483647)else tfmfour(-2147483647);
end else tfmfour(dimenout(param[k]));
if tfmchanged>0 then begin if tfmchanged=1 then printnl(1140)else begin
printnl(40);printint(tfmchanged);print(1141);end;print(1142);end{:1185};
{if internal[10]>0 then[1186:]begin writeln(logfile,' ');
if bchlabel<ligtablesize then nl:=nl-1;
writeln(logfile,'(You used ',nw:1,'w,',nh:1,'h,',nd:1,'d,',ni:1,'i,',nl:
1,'l,',nk:1,'k,',ne:1,'e,',np:1,'p metric file positions');
writeln(logfile,'  out of ','256w,16h,16d,64i,',ligtablesize:1,'l,',
maxkerns:1,'k,256e,',maxfontdimen:1,'p)');end[:1186];}printnl(1137);
print(metricfilename);printchar(46);bclose(tfmfile){:1179};end{:1336};
{1230:}if totalshipped>0 then begin printnl(287);printint(totalshipped);
print(1165);if totalshipped>1 then printchar(115);print(1166);
print(firstfilename);
if totalshipped>1 then begin if 31+(strstart[nextstr[firstfilename]]-
strstart[firstfilename])+(strstart[nextstr[lastfilename]]-strstart[
lastfilename])>maxprintline then println;print(569);print(lastfilename);
end;end{:1230};if logopened then begin writeln(logfile);aclose(logfile);
selector:=selector-2;if selector=8 then begin printnl(1306);
print(logname);printchar(46);end;end;end;
{:1334}{1339:}procedure finalcleanup;label 10;var c:smallnumber;
begin c:=curmod;if jobname=0 then openlogfile;
while inputptr>0 do if(curinput.indexfield>6)then endtokenlist else
endfilereading;while loopptr<>0 do stopiteration;
while openparens>0 do begin print(1307);openparens:=openparens-1;end;
while condptr<>0 do begin printnl(1308);printcmdmod(5,curif);
if ifline<>0 then begin print(1309);printint(ifline);end;print(1310);
ifline:=mem[condptr+1].int;curif:=mem[condptr].hh.b1;
condptr:=mem[condptr].hh.rh;end;
if history<>0 then if((history=1)or(interaction<3))then if selector=10
then begin selector:=8;printnl(1311);selector:=10;end;
if c=1 then begin storememfile;goto 10;printnl(1312);goto 10;end;10:end;
{:1339}{1340:}procedure initprim;begin{209:}primitive(441,42,1);
primitive(442,42,2);primitive(443,42,3);primitive(444,42,4);
primitive(445,42,5);primitive(446,42,6);primitive(447,42,7);
primitive(448,42,8);primitive(449,42,9);primitive(450,42,10);
primitive(451,42,11);primitive(452,42,12);primitive(453,42,13);
primitive(454,42,14);primitive(455,42,15);primitive(456,42,16);
primitive(457,42,17);primitive(458,42,18);primitive(459,42,19);
primitive(460,42,20);primitive(461,42,21);primitive(462,42,22);
primitive(463,42,23);primitive(464,42,24);primitive(465,42,25);
primitive(466,42,26);primitive(467,42,27);primitive(468,42,28);
primitive(469,42,29);primitive(470,42,30);primitive(471,42,31);
primitive(472,42,32);primitive(473,42,33);primitive(474,42,36);
primitive(475,42,37);primitive(476,42,34);primitive(477,42,35);
{:209}{229:}primitive(324,49,0);primitive(91,65,0);
eqtb[2360]:=eqtb[cursym];primitive(93,66,0);primitive(125,67,0);
primitive(123,48,0);primitive(58,80,0);eqtb[2362]:=eqtb[cursym];
primitive(488,79,0);primitive(489,78,0);primitive(490,76,0);
primitive(44,81,0);primitive(59,82,0);eqtb[2363]:=eqtb[cursym];
primitive(92,10,0);primitive(491,20,0);primitive(492,61,0);
primitive(493,34,0);bgloc:=cursym;primitive(494,59,0);
primitive(495,62,0);primitive(496,29,0);primitive(482,83,0);
eqtb[2367]:=eqtb[cursym];egloc:=cursym;primitive(497,28,0);
primitive(498,9,0);primitive(499,12,0);primitive(500,15,0);
primitive(501,16,0);primitive(502,17,0);primitive(503,70,0);
primitive(504,26,0);primitive(505,14,0);primitive(506,11,0);
primitive(507,19,0);primitive(508,77,0);primitive(509,30,0);
primitive(510,30,1);primitive(511,30,2);primitive(512,72,0);
primitive(513,37,0);primitive(514,60,0);primitive(515,71,0);
primitive(516,73,0);primitive(517,74,0);primitive(518,31,0);
{:229}{648:}primitive(706,1,0);primitive(707,1,1);primitive(479,2,0);
eqtb[2368]:=eqtb[cursym];primitive(480,3,0);eqtb[2369]:=eqtb[cursym];
{:648}{656:}primitive(720,18,1);primitive(721,18,2);
primitive(722,18,55);primitive(723,18,46);primitive(724,18,51);
primitive(483,18,0);eqtb[2365]:=eqtb[cursym];primitive(725,7,2372);
primitive(726,7,2522);primitive(727,7,1);primitive(484,7,0);
eqtb[2364]:=eqtb[cursym];{:656}{661:}primitive(728,63,0);
primitive(729,63,1);primitive(64,63,2);primitive(730,63,3);
{:661}{668:}primitive(741,58,2372);primitive(742,58,2522);
primitive(743,58,2672);primitive(744,58,1);primitive(745,58,2);
primitive(746,58,3);{:668}{682:}primitive(756,6,0);primitive(653,6,1);
{:682}{713:}primitive(783,4,1);primitive(481,5,2);
eqtb[2366]:=eqtb[cursym];primitive(784,5,3);primitive(785,5,4);
{:713}{882:}primitive(351,35,30);primitive(352,35,31);
primitive(353,35,32);primitive(354,35,33);primitive(355,35,34);
primitive(356,35,35);primitive(357,35,36);primitive(358,35,37);
primitive(359,36,38);primitive(360,36,39);primitive(361,36,40);
primitive(362,36,41);primitive(363,36,42);primitive(364,36,43);
primitive(365,36,44);primitive(366,36,45);primitive(367,36,46);
primitive(368,36,47);primitive(369,36,48);primitive(370,36,49);
primitive(371,36,50);primitive(372,36,51);primitive(373,36,52);
primitive(374,36,53);primitive(375,36,55);primitive(376,36,56);
primitive(377,36,57);primitive(378,36,58);primitive(379,36,59);
primitive(380,36,60);primitive(381,36,61);primitive(382,36,62);
primitive(383,36,63);primitive(384,36,64);primitive(385,36,65);
primitive(386,36,66);primitive(387,36,67);primitive(388,36,68);
primitive(389,36,54);primitive(390,36,69);primitive(391,36,70);
primitive(392,36,71);primitive(393,36,72);primitive(394,36,73);
primitive(395,36,74);primitive(396,36,75);primitive(397,36,76);
primitive(398,36,77);primitive(399,36,78);primitive(400,36,79);
primitive(401,36,80);primitive(402,36,81);primitive(403,36,82);
primitive(404,36,83);primitive(405,36,84);primitive(406,36,85);
primitive(407,36,86);primitive(408,36,87);primitive(409,36,88);
primitive(410,38,89);primitive(412,36,91);primitive(411,36,90);
primitive(413,36,92);primitive(414,36,93);primitive(415,36,94);
primitive(43,45,95);primitive(45,45,96);primitive(42,57,97);
primitive(47,56,98);eqtb[2361]:=eqtb[cursym];primitive(416,47,99);
primitive(313,47,100);primitive(417,47,101);primitive(418,54,102);
primitive(60,52,103);primitive(419,52,104);primitive(62,52,105);
primitive(420,52,106);primitive(61,53,107);primitive(421,52,108);
primitive(432,39,121);primitive(433,39,122);primitive(434,39,123);
primitive(435,39,124);primitive(436,39,125);primitive(437,39,126);
primitive(438,39,127);primitive(439,39,128);primitive(440,35,129);
primitive(38,50,109);primitive(422,57,110);primitive(423,57,111);
primitive(424,57,112);primitive(425,57,113);primitive(426,57,114);
primitive(427,57,115);primitive(428,57,116);primitive(429,57,117);
primitive(430,57,118);primitive(431,47,119);
{:882}{1035:}primitive(344,32,16);primitive(260,32,4);
primitive(328,32,2);primitive(333,32,8);primitive(331,32,6);
primitive(335,32,10);primitive(337,32,12);primitive(338,32,13);
primitive(978,32,13);primitive(339,32,14);primitive(340,32,15);
{:1035}{1040:}primitive(991,84,0);primitive(992,84,1);
{:1040}{1046:}primitive(275,25,0);primitive(276,25,1);
primitive(277,25,2);primitive(998,25,3);
{:1046}{1049:}primitive(999,23,0);primitive(1000,23,1);
{:1049}{1059:}primitive(1014,24,0);primitive(1015,24,1);
primitive(1016,24,2);primitive(1017,24,3);primitive(1018,24,4);
{:1059}{1075:}primitive(1037,69,0);primitive(1038,69,1);
primitive(1039,69,2);primitive(1040,68,6);primitive(1041,68,10);
primitive(1042,68,11);primitive(1043,68,13);primitive(1044,68,1);
primitive(1045,68,3);primitive(1046,68,9);primitive(1047,68,5);
primitive(1048,68,7);{:1075}{1097:}primitive(1062,21,4);
primitive(1063,21,5);{:1097}{1117:}primitive(1076,27,0);
primitive(1077,27,1);primitive(1078,27,2);primitive(1079,27,3);
{:1117}{1146:}primitive(1094,22,0);primitive(1095,22,1);
primitive(1096,22,2);primitive(1097,22,3);primitive(1098,22,4);
{:1146}{1153:}primitive(1116,75,0);primitive(1117,75,1);
primitive(1118,75,5);primitive(1119,75,2);primitive(1120,75,6);
primitive(1121,75,3);primitive(1122,75,7);primitive(1123,75,11);
primitive(1124,75,128);{:1153};end;procedure inittab;var k:integer;
begin{190:}rover:=24;mem[rover].hh.rh:=65535;mem[rover].hh.lh:=1000;
mem[rover+1].hh.lh:=rover;mem[rover+1].hh.rh:=rover;
lomemmax:=rover+1000;mem[lomemmax].hh.rh:=0;mem[lomemmax].hh.lh:=0;
for k:=29997 to 30000 do mem[k]:=mem[lomemmax];avail:=0;memend:=30000;
himemmin:=29997;varused:=24;dynused:=30001-(29997);
{363:}mem[14].int:=-32768;mem[15].int:=0;mem[17].int:=32768;
mem[18].int:=0;mem[20].int:=0;mem[21].int:=65536;mem[13].hh.rh:=16;
mem[16].hh.rh:=19;mem[19].hh.rh:=13;mem[13].hh.lh:=19;mem[16].hh.lh:=13;
mem[19].hh.lh:=16{:363};{:190}{210:}internal[34]:=(5*65536);
internal[35]:=65536;{:210}{211:}intname[1]:=441;intname[2]:=442;
intname[3]:=443;intname[4]:=444;intname[5]:=445;intname[6]:=446;
intname[7]:=447;intname[8]:=448;intname[9]:=449;intname[10]:=450;
intname[11]:=451;intname[12]:=452;intname[13]:=453;intname[14]:=454;
intname[15]:=455;intname[16]:=456;intname[17]:=457;intname[18]:=458;
intname[19]:=459;intname[20]:=460;intname[21]:=461;intname[22]:=462;
intname[23]:=463;intname[24]:=464;intname[25]:=465;intname[26]:=466;
intname[27]:=467;intname[28]:=468;intname[29]:=469;intname[30]:=470;
intname[31]:=471;intname[32]:=472;intname[33]:=473;intname[34]:=476;
intname[36]:=474;intname[37]:=475;intname[35]:=477;
{:211}{221:}hashused:=2357;stcount:=0;hash[2370].rh:=478;
hash[2368].rh:=479;hash[2369].rh:=480;hash[2366].rh:=481;
hash[2367].rh:=482;hash[2365].rh:=483;hash[2364].rh:=484;
hash[2363].rh:=59;hash[2362].rh:=58;hash[2361].rh:=47;hash[2360].rh:=91;
hash[2359].rh:=41;hash[2357].rh:=485;eqtb[2359].lh:=64;
{:221}{233:}mem[0].hh.rh:=0;mem[1].int:=0;
{:233}{248:}mem[11].hh.lh:=2372;mem[11].hh.rh:=0;
{:248}{542:}serialno:=0;mem[5].hh.rh:=5;mem[6].hh.lh:=5;mem[5].hh.lh:=0;
mem[6].hh.rh:=0;{:542}{675:}mem[22].hh.b1:=0;mem[22].hh.rh:=2370;
eqtb[2370].rh:=22;eqtb[2370].lh:=43;{:675}{733:}eqtb[2358].lh:=93;
hash[2358].rh:=800;{:733}{901:}mem[9].hh.b1:=19;
{:901}{1161:}mem[12].int:=1073741824;{:1161}{1172:}mem[8].int:=0;
mem[7].hh.lh:=0;{:1172}{1191:}fontdsize[0]:=0;fontname[0]:=287;
fontpsname[0]:=287;fontbc[0]:=1;fontec[0]:=0;charbase[0]:=0;
widthbase[0]:=0;heightbase[0]:=0;depthbase[0]:=0;nextfmem:=0;
lastfnum:=0;lastpsfnum:=0;{:1191}{1314:}memident:=1298;{:1314}end;
{:1340}{1342:}{procedure debughelp;label 888,10;var k,l,m,n:integer;
begin while true do begin;printnl(1313);break(termout);read(termin,m);
if m<0 then goto 10 else if m=0 then begin goto 888;
888:m:=0;
['BREAKPOINT']
end else begin read(termin,n);case m of[1343:]1:printword(mem[n]);
2:printint(mem[n].hh.lh);3:printint(mem[n].hh.rh);
4:begin printint(eqtb[n].lh);printchar(58);printint(eqtb[n].rh);end;
5:printvariablename(n);6:printint(internal[n]);7:doshowdependencies;
9:showtokenlist(n,0,100000,0);10:print(n);11:checkmem(n>0);
12:searchmem(n);13:begin read(termin,l);printcmdmod(n,l);end;
14:for k:=0 to n do print(buffer[k]);15:panicking:=not panicking;
[:1343]others:print(63)end;end;end;10:end;}
{:1342}{:1331}{1333:}begin history:=3;rewrite(termout,'TTY:','/O');
if readyalready=314159 then goto 1;{14:}bad:=0;
if(halferrorline<30)or(halferrorline>errorline-15)then bad:=1;
if maxprintline<60 then bad:=2;
if emergencylinelength<maxprintline then bad:=3;
if 1100>30000 then bad:=4;if 1777>2100 then bad:=5;
if headersize mod 4<>0 then bad:=6;
if(ligtablesize<255)or(ligtablesize>32510)then bad:=7;
{:14}{168:}if memmax<>30000 then bad:=8;if memmax<30000 then bad:=8;
if(0>0)or(255<127)then bad:=9;if(0>0)or(65535<32767)then bad:=10;
if(0<0)or(255>65535)then bad:=11;if(0<0)or(memmax>=65535)then bad:=12;
if maxstrings>65535 then bad:=13;if bufsize>65535 then bad:=14;
if fontmax>65535 then bad:=15;if(255<255)or(65535<65535)then bad:=16;
{:168}{222:}if 2371+maxinternal>65535 then bad:=17;
{:222}{232:}if 2822>65535 then bad:=18;
{:232}{529:}if 20+17*45>bistacksize then bad:=19;
{:529}{755:}if 15>filenamesize then bad:=20;
{:755}if bad>0 then begin writeln(termout,
'Ouch---my internal constants have been clobbered!','---case ',bad:1);
goto 9999;end;initialize;if not getstringsstarted then goto 9999;
inittab;initprim;initstruse:=strptr;initpoolptr:=poolptr;
maxstrptr:=strptr;maxpoolptr:=poolptr;fixdateandtime;
readyalready:=314159;1:{69:}selector:=8;tally:=0;termoffset:=0;
fileoffset:=0;psoffset:=0;{:69}{75:}break(termout);
{:75}{762:}jobname:=0;logopened:=false;{:762};
{1341:}begin{617:}begin inputptr:=0;maxinstack:=0;inopen:=0;
openparens:=0;maxbufstack:=0;paramptr:=0;maxparamstack:=0;first:=1;
curinput.startfield:=1;curinput.indexfield:=0;
linestack[curinput.indexfield]:=0;curinput.namefield:=0;mpxname[0]:=1;
forceeof:=false;if not initterminal then goto 9999;
curinput.limitfield:=last;first:=last+1;end;
{:617}{620:}scannerstatus:=0;{:620};
if(memident=0)or(buffer[curinput.locfield]=38)then begin if memident<>0
then initialize;if not openmemfile then goto 9999;
if not loadmemfile then begin wclose(memfile);goto 9999;end;
wclose(memfile);
while(curinput.locfield<curinput.limitfield)and(buffer[curinput.locfield
]=32)do curinput.locfield:=curinput.locfield+1;end;
buffer[curinput.limitfield]:=37;fixdateandtime;
sysrandomseed:=(internal[16]div 65536)+internal[15];
initrandoms(sysrandomseed);
{84:}if interaction=0 then selector:=7 else selector:=8{:84};
if curinput.locfield<curinput.limitfield then if buffer[curinput.
locfield]<>92 then startinput;end{:1341};mpinitmapfile(troffmode);
setjobid(internal[13],internal[14],internal[15],internal[16]);
history:=0;if startsym>0 then begin cursym:=startsym;backinput;end;
maincontrol;finalcleanup;9998:closefilesandterminate;
9999:readyalready:=0;end.{:1333}
